From 83452f328213c7f5296652efd3d017f8b3e0184a Mon Sep 17 00:00:00 2001 From: Wes Reed Date: Tue, 6 Dec 2022 16:45:41 -0500 Subject: [PATCH 001/476] fix: brought back custom modal attributes from v3 --- packages/coreui-react/src/components/modal/CModal.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/coreui-react/src/components/modal/CModal.tsx b/packages/coreui-react/src/components/modal/CModal.tsx index 5bfb7a61..65ae9667 100644 --- a/packages/coreui-react/src/components/modal/CModal.tsx +++ b/packages/coreui-react/src/components/modal/CModal.tsx @@ -108,6 +108,7 @@ export const CModal = forwardRef( transition = true, unmountOnClose = true, visible, + ...attributes }, ref, ) => { @@ -232,6 +233,7 @@ export const CModal = forwardRef( fullscreen={fullscreen} scrollable={scrollable} size={size} + {...attributes} > {children} From 09f959fac95759875aa03d4140dd85ac07337386 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Holeczek?= Date: Sat, 10 Dec 2022 14:02:54 +0100 Subject: [PATCH 002/476] build: update rollup config --- packages/coreui-icons-react/package.json | 2 +- packages/coreui-react-chartjs/package.json | 8 ++++++-- packages/coreui-react/package.json | 3 +-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/coreui-icons-react/package.json b/packages/coreui-icons-react/package.json index dddcde01..158be4f6 100644 --- a/packages/coreui-icons-react/package.json +++ b/packages/coreui-icons-react/package.json @@ -32,7 +32,7 @@ "src/" ], "scripts": { - "build": "rollup -c" + "build": "rollup -c --bundleConfigAsCjs" }, "devDependencies": { "@rollup/plugin-commonjs": "^23.0.2", diff --git a/packages/coreui-react-chartjs/package.json b/packages/coreui-react-chartjs/package.json index 113c8039..e8065216 100644 --- a/packages/coreui-react-chartjs/package.json +++ b/packages/coreui-react-chartjs/package.json @@ -35,11 +35,11 @@ "src/" ], "scripts": { - "build": "rollup -c" + "build": "rollup -c --bundleConfigAsCjs" }, "dependencies": { "@coreui/chartjs": "^3.0.0", - "chart.js": "^3.9.1" + "chart.js": "3.9.1" }, "devDependencies": { "@rollup/plugin-commonjs": "^23.0.2", @@ -48,9 +48,13 @@ "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.4.0", "@types/lodash": "^4.14.181", + "@types/react": "18.0.25", + "@types/react-dom": "^18.0.6", "classnames": "^2.3.2", "lodash": "^4.17.21", "prop-types": "^15.8.1", + "react": "^18.2.0", + "react-dom": "^18.2.0", "rollup": "^3.4.0", "typescript": "^4.9.3" }, diff --git a/packages/coreui-react/package.json b/packages/coreui-react/package.json index 9e7951ac..2a011847 100644 --- a/packages/coreui-react/package.json +++ b/packages/coreui-react/package.json @@ -27,13 +27,12 @@ "module": "dist/index.es.js", "jsnext:main": "dist/index.es.js", "types": "dist/index.d.ts", - "type": "module", "files": [ "dist/", "src/" ], "scripts": { - "build": "rollup -c" + "build": "rollup -c --bundleConfigAsCjs" }, "devDependencies": { "@popperjs/core": "^2.11.5", From dfccf071bff4f8283990a20bae5ca6baada6b23f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Holeczek?= Date: Sat, 10 Dec 2022 15:06:40 +0100 Subject: [PATCH 003/476] refactor: prevent unnecessary redrawing --- packages/coreui-react-chartjs/src/CChart.tsx | 336 ++++++++++-------- packages/coreui-react-chartjs/src/CCharts.tsx | 50 +-- 2 files changed, 208 insertions(+), 178 deletions(-) diff --git a/packages/coreui-react-chartjs/src/CChart.tsx b/packages/coreui-react-chartjs/src/CChart.tsx index 1e1730c6..4927efac 100644 --- a/packages/coreui-react-chartjs/src/CChart.tsx +++ b/packages/coreui-react-chartjs/src/CChart.tsx @@ -5,12 +5,21 @@ import React, { useEffect, useImperativeHandle, useMemo, - useState, useRef, } from 'react' import classNames from 'classnames' -import Chart, { ChartData, ChartOptions, ChartType, InteractionItem, Plugin } from 'chart.js/auto' +import { Chart as ChartJS, registerables } from 'chart.js' +import type { + ChartData, + ChartOptions, + ChartType, + ChartTypeRegistry, + InteractionItem, + Plugin, + ScatterDataPoint, + BubbleDataPoint, +} from 'chart.js' import { customTooltips as cuiCustomTooltips } from '@coreui/chartjs' import assign from 'lodash/assign' @@ -92,7 +101,7 @@ export interface CChartProps extends HTMLAttributes((props, ref) => { - const { - className, - customTooltips = true, - data, - id, - fallbackContent, - getDatasetAtEvent, - getElementAtEvent, - getElementsAtEvent, - height = 150, - options, - plugins = [], - redraw = false, - type, - width = 300, - wrapper = true, - ...rest - } = props - - const canvasRef = useRef(null) - - const computedData = useMemo(() => { - if (typeof data === 'function') { - return canvasRef.current ? data(canvasRef.current) : { datasets: [] } - } else return merge({}, data) - }, [data, canvasRef.current]) - - const computedOptions = useMemo(() => { - return customTooltips - ? merge({}, options, { - plugins: { - tooltip: { - enabled: false, - mode: 'index', - position: 'nearest', - external: cuiCustomTooltips, - }, - }, - }) - : options - }, [data, canvasRef.current, options]) +export const CChart = forwardRef( + ( + { + className, + customTooltips = true, + data, + id, + fallbackContent, + getDatasetAtEvent, + getElementAtEvent, + getElementsAtEvent, + height = 150, + options, + plugins = [], + redraw = false, + type = 'bar', + width = 300, + wrapper = true, + ...rest + }, + ref, + ) => { + ChartJS.register(...registerables) + + const canvasRef = useRef(null) + const chartRef = useRef< + | ChartJS< + keyof ChartTypeRegistry, + (number | ScatterDataPoint | BubbleDataPoint | null)[], + unknown + > + | undefined + >() + + useImperativeHandle(ref, () => chartRef.current, [ + chartRef, + ]) + + const computedData = useMemo(() => { + if (typeof data === 'function') { + return canvasRef.current ? data(canvasRef.current) : { datasets: [] } + } - const [chart, setChart] = useState() + return merge({}, data) + }, [canvasRef.current, JSON.stringify(data)]) - useImperativeHandle(ref, () => chart, [chart]) + const computedOptions = useMemo(() => { + return customTooltips + ? merge({}, options, { + plugins: { + tooltip: { + enabled: false, + mode: 'index', + position: 'nearest', + external: cuiCustomTooltips, + }, + }, + }) + : options + }, [canvasRef.current, JSON.stringify(options)]) - const renderChart = () => { - if (!canvasRef.current) return + const renderChart = () => { + if (!canvasRef.current) return - setChart( - new Chart(canvasRef.current, { + chartRef.current = new ChartJS(canvasRef.current, { type, data: computedData, options: computedOptions, plugins, - }), - ) - } + }) + } - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const handleOnClick = (e: any) => { - if (!chart) return + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const handleOnClick = (e: any) => { + if (!chartRef.current) return - getDatasetAtEvent && - getDatasetAtEvent( - chart.getElementsAtEventForMode(e, 'dataset', { intersect: true }, false), - e, - ) - getElementAtEvent && - getElementAtEvent( - chart.getElementsAtEventForMode(e, 'nearest', { intersect: true }, false), - e, - ) - getElementsAtEvent && - getElementsAtEvent(chart.getElementsAtEventForMode(e, 'index', { intersect: true }, false), e) - } + getDatasetAtEvent && + getDatasetAtEvent( + chartRef.current.getElementsAtEventForMode(e, 'dataset', { intersect: true }, false), + e, + ) + getElementAtEvent && + getElementAtEvent( + chartRef.current.getElementsAtEventForMode(e, 'nearest', { intersect: true }, false), + e, + ) + getElementsAtEvent && + getElementsAtEvent( + chartRef.current.getElementsAtEventForMode(e, 'index', { intersect: true }, false), + e, + ) + } - const updateChart = () => { - if (!chart) return + const updateChart = () => { + if (!chartRef.current) return - if (options) { - chart.options = { ...computedOptions } - } + if (options) { + chartRef.current.options = { ...computedOptions } + } - if (!chart.config.data) { - chart.config.data = computedData - chart.update() - return - } + if (!chartRef.current.config.data) { + chartRef.current.config.data = computedData + chartRef.current.update() + return + } - const { datasets: newDataSets = [], ...newChartData } = computedData - const { datasets: currentDataSets = [] } = chart.config.data + const { datasets: newDataSets = [], ...newChartData } = computedData + const { datasets: currentDataSets = [] } = chartRef.current.config.data - // copy values - assign(chart.config.data, newChartData) - // eslint-disable-next-line @typescript-eslint/no-explicit-any - chart.config.data.datasets = newDataSets.map((newDataSet: any) => { - // given the new set, find it's current match - const currentDataSet = find( - currentDataSets, - (d) => d.label === newDataSet.label && d.type === newDataSet.type, - ) + // copy values + assign(chartRef.current.config.data, newChartData) + // eslint-disable-next-line @typescript-eslint/no-explicit-any + chartRef.current.config.data.datasets = newDataSets.map((newDataSet: any) => { + // given the new set, find it's current match + const currentDataSet = find( + currentDataSets, + (d) => d.label === newDataSet.label && d.type === newDataSet.type, + ) - // There is no original to update, so simply add new one - if (!currentDataSet || !newDataSet.data) return newDataSet + // There is no original to update, so simply add new one + if (!currentDataSet || !newDataSet.data) return newDataSet - if (!currentDataSet.data) { - currentDataSet.data = [] - } else { - currentDataSet.data.length = newDataSet.data.length - } + if (!currentDataSet.data) { + currentDataSet.data = [] + } else { + currentDataSet.data.length = newDataSet.data.length + } + + // copy in values + assign(currentDataSet.data, newDataSet.data) + + // apply dataset changes, but keep copied data + return { + ...currentDataSet, + ...newDataSet, + data: currentDataSet.data, + } + }) - // copy in values - assign(currentDataSet.data, newDataSet.data) + chartRef.current.update() + } - // apply dataset changes, but keep copied data - return { - ...currentDataSet, - ...newDataSet, - data: currentDataSet.data, + const destroyChart = () => { + if (chartRef.current) { + chartRef.current.destroy() + chartRef.current = undefined } - }) + } - chart.update() - } + useEffect(() => { + renderChart() - const destroyChart = () => { - if (chart) chart.destroy() - } + return () => destroyChart() + }, []) - useEffect(() => { - renderChart() + useEffect(() => { + if (!chartRef.current) return - return () => destroyChart() - }, []) + if (redraw) { + destroyChart() + setTimeout(() => { + renderChart() + }, 0) + } else { + updateChart() + } + }, [JSON.stringify(data), computedData]) - useEffect(() => { - if (redraw) { - destroyChart() - setTimeout(() => { - renderChart() - }, 0) - } else { - updateChart() + const canvas = (ref: React.Ref) => { + return ( + ) => { + handleOnClick(e) + }} + ref={ref} + role="img" + width={width} + {...rest} + > + {fallbackContent} + + ) } - }, [props, computedData]) - - const canvas = (ref: React.Ref) => { - return ( - ) => { - handleOnClick(e) - }} - ref={ref} - role="img" - width={width} - {...rest} - > - {fallbackContent} - - ) - } - return wrapper ? ( -
- {canvas(canvasRef)} -
- ) : ( - canvas(canvasRef) - ) -}) + return wrapper ? ( +
+ {canvas(canvasRef)} +
+ ) : ( + canvas(canvasRef) + ) + }, +) CChart.propTypes = { className: PropTypes.string, customTooltips: PropTypes.bool, - data: PropTypes.any.isRequired, // TODO: check + data: PropTypes.any.isRequired, // TODO: improve this type fallbackContent: PropTypes.node, getDatasetAtEvent: PropTypes.func, getElementAtEvent: PropTypes.func, diff --git a/packages/coreui-react-chartjs/src/CCharts.tsx b/packages/coreui-react-chartjs/src/CCharts.tsx index 4bda0afd..ace1e2f7 100644 --- a/packages/coreui-react-chartjs/src/CCharts.tsx +++ b/packages/coreui-react-chartjs/src/CCharts.tsx @@ -1,51 +1,51 @@ import React, { forwardRef } from 'react' import { CChart, CChartProps } from './CChart' -import Chart from 'chart.js/auto' +import { Chart as ChartJS } from 'chart.js' -export const CChartBar = forwardRef((props, ref) => ( - -)) +export const CChartBar = forwardRef>( + (props, ref) => , +) CChartBar.displayName = 'CChartBar' -export const CChartBubble = forwardRef((props, ref) => ( - -)) +export const CChartBubble = forwardRef>( + (props, ref) => , +) CChartBubble.displayName = 'CChartBubble' -export const CChartDoughnut = forwardRef((props, ref) => ( - -)) +export const CChartDoughnut = forwardRef>( + (props, ref) => , +) CChartDoughnut.displayName = 'CChartDoughnut' -export const CChartLine = forwardRef((props, ref) => ( - -)) +export const CChartLine = forwardRef>( + (props, ref) => , +) CChartLine.displayName = 'CChartLine' -export const CChartPie = forwardRef((props, ref) => ( - -)) +export const CChartPie = forwardRef>( + (props, ref) => , +) CChartPie.displayName = 'CChartPie' -export const CChartPolarArea = forwardRef((props, ref) => ( - -)) +export const CChartPolarArea = forwardRef>( + (props, ref) => , +) CChartPolarArea.displayName = 'CChartPolarArea' -export const CChartRadar = forwardRef((props, ref) => ( - -)) +export const CChartRadar = forwardRef>( + (props, ref) => , +) CChartRadar.displayName = 'CChartRadar' -export const CChartScatter = forwardRef((props, ref) => ( - -)) +export const CChartScatter = forwardRef>( + (props, ref) => , +) CChartScatter.displayName = 'CChartScatter' From 14ee31bbd2846766b8ad0bb6f1e8e8380d5dfe99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Holeczek?= Date: Sat, 10 Dec 2022 15:19:27 +0100 Subject: [PATCH 004/476] chore: update dependencies and devDependencies --- package.json | 8 +- packages/coreui-icons-react/package.json | 10 +- packages/coreui-react-chartjs/package.json | 12 +- packages/coreui-react/package.json | 10 +- packages/docs/package.json | 2 +- yarn.lock | 203 ++++++++++----------- 6 files changed, 116 insertions(+), 129 deletions(-) diff --git a/package.json b/package.json index 646be99f..742ae3c4 100644 --- a/package.json +++ b/package.json @@ -16,9 +16,9 @@ "test:update": "jest --coverage --updateSnapshot" }, "devDependencies": { - "@typescript-eslint/eslint-plugin": "^5.32.0", - "@typescript-eslint/parser": "^5.32.0", - "eslint": "8.28.0", + "@typescript-eslint/eslint-plugin": "^5.46.0", + "@typescript-eslint/parser": "^5.46.0", + "eslint": "8.29.0", "eslint-config-prettier": "^8.5.0", "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-react": "^7.30.1", @@ -27,7 +27,7 @@ "jest-canvas-mock": "^2.3.1", "jest-environment-jsdom": "^28.1.3", "lerna": "^4.0.0", - "prettier": "^2.7.1", + "prettier": "^2.8.1", "ts-jest": "^28.0.7" } } \ No newline at end of file diff --git a/packages/coreui-icons-react/package.json b/packages/coreui-icons-react/package.json index 158be4f6..5572f22f 100644 --- a/packages/coreui-icons-react/package.json +++ b/packages/coreui-icons-react/package.json @@ -35,20 +35,20 @@ "build": "rollup -c --bundleConfigAsCjs" }, "devDependencies": { - "@rollup/plugin-commonjs": "^23.0.2", + "@rollup/plugin-commonjs": "^23.0.4", "@rollup/plugin-node-resolve": "^15.0.1", - "@rollup/plugin-typescript": "^9.0.2", + "@rollup/plugin-typescript": "^10.0.1", "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.4.0", - "@types/react": "^18.0.25", + "@types/react": "^18.0.26", "@types/react-dom": "^18.0.6", "classnames": "^2.3.2", "prop-types": "^15.8.1", "react": "^18.2.0", "react-dom": "^18.2.0", - "rollup": "^3.4.0", + "rollup": "^3.7.2", "rollup-plugin-import-css": "^3.0.3", - "typescript": "^4.9.3" + "typescript": "^4.9.4" }, "peerDependencies": { "react": ">=17", diff --git a/packages/coreui-react-chartjs/package.json b/packages/coreui-react-chartjs/package.json index e8065216..23567ccf 100644 --- a/packages/coreui-react-chartjs/package.json +++ b/packages/coreui-react-chartjs/package.json @@ -42,21 +42,21 @@ "chart.js": "3.9.1" }, "devDependencies": { - "@rollup/plugin-commonjs": "^23.0.2", + "@rollup/plugin-commonjs": "^23.0.4", "@rollup/plugin-node-resolve": "^15.0.1", - "@rollup/plugin-typescript": "^9.0.2", + "@rollup/plugin-typescript": "^10.0.1", "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.4.0", - "@types/lodash": "^4.14.181", - "@types/react": "18.0.25", + "@types/lodash": "^4.14.191", + "@types/react": "18.0.26", "@types/react-dom": "^18.0.6", "classnames": "^2.3.2", "lodash": "^4.17.21", "prop-types": "^15.8.1", "react": "^18.2.0", "react-dom": "^18.2.0", - "rollup": "^3.4.0", - "typescript": "^4.9.3" + "rollup": "^3.7.2", + "typescript": "^4.9.4" }, "peerDependencies": { "react": ">=17", diff --git a/packages/coreui-react/package.json b/packages/coreui-react/package.json index 2a011847..40167626 100644 --- a/packages/coreui-react/package.json +++ b/packages/coreui-react/package.json @@ -36,12 +36,12 @@ }, "devDependencies": { "@popperjs/core": "^2.11.5", - "@rollup/plugin-commonjs": "^23.0.2", + "@rollup/plugin-commonjs": "^23.0.4", "@rollup/plugin-node-resolve": "^15.0.1", - "@rollup/plugin-typescript": "^8.5.0", + "@rollup/plugin-typescript": "^10.0.1", "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.4.0", - "@types/react": "18.0.25", + "@types/react": "18.0.26", "@types/react-dom": "^18.0.6", "@types/react-transition-group": "^4.4.5", "classnames": "^2.3.2", @@ -50,9 +50,9 @@ "react-dom": "^18.2.0", "react-popper": "^2.2.5", "react-transition-group": "^4.4.5", - "rollup": "^3.4.0", + "rollup": "^3.7.2", "tslib": "^2.4.1", - "typescript": "^4.9.3" + "typescript": "^4.9.4" }, "peerDependencies": { "react": ">=17", diff --git a/packages/docs/package.json b/packages/docs/package.json index a26b3cc8..d187a425 100644 --- a/packages/docs/package.json +++ b/packages/docs/package.json @@ -28,7 +28,7 @@ }, "dependencies": { "@coreui/chartjs": "^3.0.0", - "@coreui/coreui": "^4.2.2", + "@coreui/coreui": "^4.2.4", "@coreui/icons": "^2.1.0", "@coreui/icons-react": "^2.0.0", "@coreui/react-chartjs": "^2.0.0", diff --git a/yarn.lock b/yarn.lock index 19ecee2a..95798fc1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1136,10 +1136,10 @@ resolved "https://registry.yarnpkg.com/@coreui/coreui/-/coreui-4.0.0.tgz#52ebe0197411a829ba48057ade61923e05859eec" integrity sha512-8vH6fJrmvCR/Oy5v0E+/1AL3Ygb4jhQ7NXK2fMYWJyK13BePDm9muB3y6S0IdqkpBwjY3hHVwHyt2lJqJdesmQ== -"@coreui/coreui@^4.2.2": - version "4.2.3" - resolved "https://registry.yarnpkg.com/@coreui/coreui/-/coreui-4.2.3.tgz#defa1b7123ec004ff43062f80f42596ea94efddb" - integrity sha512-jOi1Rc9Xu72WkGUBdXsUivi06KAOnW9KQvxuXYdMkCEyc5FwVJFmeVk6x7/1iCExtRD1rs4oChLJPwXg1sBcvg== +"@coreui/coreui@^4.2.4": + version "4.2.4" + resolved "https://registry.yarnpkg.com/@coreui/coreui/-/coreui-4.2.4.tgz#8050810849ba4f0ed411f2a91d5ae2cab87522d6" + integrity sha512-ENXa+SJab0Wv4TggVmY2umrWKEapWaCYPDwfdxGWd9SywsJX16R35lejpeSaHSZpgTZq+8WlFu/AyOhI1M/d9A== dependencies: postcss-combine-duplicated-selectors "^10.0.3" @@ -3073,10 +3073,10 @@ resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.6.tgz#cee20bd55e68a1720bdab363ecf0c821ded4cd45" integrity sha512-50/17A98tWUfQ176raKiOGXuYpLyyVMkxxG6oylzL3BPOlA6ADGdK7EYunSa4I064xerltq9TGXs8HmOk5E+vw== -"@rollup/plugin-commonjs@^23.0.2": - version "23.0.2" - resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-23.0.2.tgz#3a3a5b7b1b1cb29037eb4992edcaae997d7ebd92" - integrity sha512-e9ThuiRf93YlVxc4qNIurvv+Hp9dnD+4PjOqQs5vAYfcZ3+AXSrcdzXnVjWxcGQOa6KGJFcRZyUI3ktWLavFjg== +"@rollup/plugin-commonjs@^23.0.4": + version "23.0.4" + resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-23.0.4.tgz#854e9b1a83f0a715ded70a2ae411bebc11141de2" + integrity sha512-bOPJeTZg56D2MCm+TT4psP8e8Jmf1Jsi7pFUMl8BN5kOADNzofNHe47+84WVCt7D095xPghC235/YKuNDEhczg== dependencies: "@rollup/pluginutils" "^5.0.1" commondir "^1.0.1" @@ -3097,31 +3097,14 @@ is-module "^1.0.0" resolve "^1.22.1" -"@rollup/plugin-typescript@^8.5.0": - version "8.5.0" - resolved "https://registry.yarnpkg.com/@rollup/plugin-typescript/-/plugin-typescript-8.5.0.tgz#7ea11599a15b0a30fa7ea69ce3b791d41b862515" - integrity sha512-wMv1/scv0m/rXx21wD2IsBbJFba8wGF3ErJIr6IKRfRj49S85Lszbxb4DCo8iILpluTjk2GAAu9CoZt4G3ppgQ== - dependencies: - "@rollup/pluginutils" "^3.1.0" - resolve "^1.17.0" - -"@rollup/plugin-typescript@^9.0.2": - version "9.0.2" - resolved "https://registry.yarnpkg.com/@rollup/plugin-typescript/-/plugin-typescript-9.0.2.tgz#c0cdfa39e267f306ff7316405a35406d5821eaa7" - integrity sha512-/sS93vmHUMjzDUsl5scNQr1mUlNE1QjBBvOhmRwJCH8k2RRhDIm3c977B3wdu3t3Ap17W6dDeXP3hj1P1Un1bA== +"@rollup/plugin-typescript@^10.0.1": + version "10.0.1" + resolved "https://registry.yarnpkg.com/@rollup/plugin-typescript/-/plugin-typescript-10.0.1.tgz#270b515b116ea28320e6bb62451c4767d49072d6" + integrity sha512-wBykxRLlX7EzL8BmUqMqk5zpx2onnmRMSw/l9M1sVfkJvdwfxogZQVNUM9gVMJbjRLDR5H6U0OMOrlDGmIV45A== dependencies: "@rollup/pluginutils" "^5.0.1" resolve "^1.22.1" -"@rollup/pluginutils@^3.1.0": - version "3.1.0" - resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b" - integrity sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg== - dependencies: - "@types/estree" "0.0.39" - estree-walker "^1.0.1" - picomatch "^2.2.2" - "@rollup/pluginutils@^5.0.1", "@rollup/pluginutils@^5.0.2": version "5.0.2" resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-5.0.2.tgz#012b8f53c71e4f6f9cb317e311df1404f56e7a33" @@ -3391,11 +3374,6 @@ resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.0.tgz#5fb2e536c1ae9bf35366eed879e827fa59ca41c2" integrity sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ== -"@types/estree@0.0.39": - version "0.0.39" - resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f" - integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw== - "@types/estree@^0.0.51": version "0.0.51" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.51.tgz#cfd70924a25a3fd32b218e5e420e6897e1ac4f40" @@ -3501,7 +3479,12 @@ dependencies: "@types/node" "*" -"@types/lodash@^4.14.181", "@types/lodash@^4.14.92": +"@types/lodash@^4.14.191": + version "4.14.191" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.191.tgz#09511e7f7cba275acd8b419ddac8da9a6a79e2fa" + integrity sha512-BdZ5BCCvho3EIXw6wUCXHe7rS53AIDPLE+JzwgT+OsJk53oBfbSmZZ7CX4VaRoN78N+TJpFi9QPlfIVNmJYWxQ== + +"@types/lodash@^4.14.92": version "4.14.190" resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.190.tgz#d8e99647af141c63902d0ca53cf2b34d2df33545" integrity sha512-5iJ3FBJBvQHQ8sFhEhJfjUP+G+LalhavTkYyrAYqz5MEJG+erSv0k9KJLb6q7++17Lafk1scaTIFXcMJlwK8Mw== @@ -3616,7 +3599,7 @@ dependencies: "@types/react" "*" -"@types/react@*", "@types/react@18.0.25", "@types/react@^18.0.25": +"@types/react@*": version "18.0.25" resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.25.tgz#8b1dcd7e56fe7315535a4af25435e0bb55c8ae44" integrity sha512-xD6c0KDT4m7n9uD4ZHi02lzskaiqcBxf4zi+tXZY98a04wvc0hi/TcCPC2FOESZi51Nd7tlUeOJY8RofL799/g== @@ -3625,6 +3608,15 @@ "@types/scheduler" "*" csstype "^3.0.2" +"@types/react@18.0.26", "@types/react@^18.0.26": + version "18.0.26" + resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.26.tgz#8ad59fc01fef8eaf5c74f4ea392621749f0b7917" + integrity sha512-hCR3PJQsAIXyxhTNSiDFY//LhnMZWpNNr5etoCqx/iUfGc5gXWtQR2Phl908jVR6uPXacojQWTg4qRpkxTuGug== + dependencies: + "@types/prop-types" "*" + "@types/scheduler" "*" + csstype "^3.0.2" + "@types/resolve@1.20.2": version "1.20.2" resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-1.20.2.tgz#97d26e00cd4a0423b4af620abecf3e6f442b7975" @@ -3743,14 +3735,14 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/eslint-plugin@^5.32.0": - version "5.44.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.44.0.tgz#105788f299050c917eb85c4d9fd04b089e3740de" - integrity sha512-j5ULd7FmmekcyWeArx+i8x7sdRHzAtXTkmDPthE4amxZOWKFK7bomoJ4r7PJ8K7PoMzD16U8MmuZFAonr1ERvw== +"@typescript-eslint/eslint-plugin@^5.46.0": + version "5.46.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.46.0.tgz#9a96a713b9616c783501a3c1774c9e2b40217ad0" + integrity sha512-QrZqaIOzJAjv0sfjY4EjbXUi3ZOFpKfzntx22gPGr9pmFcTjcFw/1sS1LJhEubfAGwuLjNrPV0rH+D1/XZFy7Q== dependencies: - "@typescript-eslint/scope-manager" "5.44.0" - "@typescript-eslint/type-utils" "5.44.0" - "@typescript-eslint/utils" "5.44.0" + "@typescript-eslint/scope-manager" "5.46.0" + "@typescript-eslint/type-utils" "5.46.0" + "@typescript-eslint/utils" "5.46.0" debug "^4.3.4" ignore "^5.2.0" natural-compare-lite "^1.4.0" @@ -3780,14 +3772,14 @@ "@typescript-eslint/typescript-estree" "4.33.0" debug "^4.3.1" -"@typescript-eslint/parser@^5.32.0": - version "5.44.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.44.0.tgz#99e2c710a2252191e7a79113264f438338b846ad" - integrity sha512-H7LCqbZnKqkkgQHaKLGC6KUjt3pjJDx8ETDqmwncyb6PuoigYajyAwBGz08VU/l86dZWZgI4zm5k2VaKqayYyA== +"@typescript-eslint/parser@^5.46.0": + version "5.46.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.46.0.tgz#002d8e67122947922a62547acfed3347cbf2c0b6" + integrity sha512-joNO6zMGUZg+C73vwrKXCd8usnsmOYmgW/w5ZW0pG0RGvqeznjtGDk61EqqTpNrFLUYBW2RSBFrxdAZMqA4OZA== dependencies: - "@typescript-eslint/scope-manager" "5.44.0" - "@typescript-eslint/types" "5.44.0" - "@typescript-eslint/typescript-estree" "5.44.0" + "@typescript-eslint/scope-manager" "5.46.0" + "@typescript-eslint/types" "5.46.0" + "@typescript-eslint/typescript-estree" "5.46.0" debug "^4.3.4" "@typescript-eslint/scope-manager@4.33.0": @@ -3798,21 +3790,21 @@ "@typescript-eslint/types" "4.33.0" "@typescript-eslint/visitor-keys" "4.33.0" -"@typescript-eslint/scope-manager@5.44.0": - version "5.44.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.44.0.tgz#988c3f34b45b3474eb9ff0674c18309dedfc3e04" - integrity sha512-2pKml57KusI0LAhgLKae9kwWeITZ7IsZs77YxyNyIVOwQ1kToyXRaJLl+uDEXzMN5hnobKUOo2gKntK9H1YL8g== +"@typescript-eslint/scope-manager@5.46.0": + version "5.46.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.46.0.tgz#60790b14d0c687dd633b22b8121374764f76ce0d" + integrity sha512-7wWBq9d/GbPiIM6SqPK9tfynNxVbfpihoY5cSFMer19OYUA3l4powA2uv0AV2eAZV6KoAh6lkzxv4PoxOLh1oA== dependencies: - "@typescript-eslint/types" "5.44.0" - "@typescript-eslint/visitor-keys" "5.44.0" + "@typescript-eslint/types" "5.46.0" + "@typescript-eslint/visitor-keys" "5.46.0" -"@typescript-eslint/type-utils@5.44.0": - version "5.44.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.44.0.tgz#bc5a6e8a0269850714a870c9268c038150dfb3c7" - integrity sha512-A1u0Yo5wZxkXPQ7/noGkRhV4J9opcymcr31XQtOzcc5nO/IHN2E2TPMECKWYpM3e6olWEM63fq/BaL1wEYnt/w== +"@typescript-eslint/type-utils@5.46.0": + version "5.46.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.46.0.tgz#3a4507b3b437e2fd9e95c3e5eea5ae16f79d64b3" + integrity sha512-dwv4nimVIAsVS2dTA0MekkWaRnoYNXY26dKz8AN5W3cBFYwYGFQEqm/cG+TOoooKlncJS4RTbFKgcFY/pOiBCg== dependencies: - "@typescript-eslint/typescript-estree" "5.44.0" - "@typescript-eslint/utils" "5.44.0" + "@typescript-eslint/typescript-estree" "5.46.0" + "@typescript-eslint/utils" "5.46.0" debug "^4.3.4" tsutils "^3.21.0" @@ -3821,10 +3813,10 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.33.0.tgz#a1e59036a3b53ae8430ceebf2a919dc7f9af6d72" integrity sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ== -"@typescript-eslint/types@5.44.0": - version "5.44.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.44.0.tgz#f3f0b89aaff78f097a2927fe5688c07e786a0241" - integrity sha512-Tp+zDnHmGk4qKR1l+Y1rBvpjpm5tGXX339eAlRBDg+kgZkz9Bw+pqi4dyseOZMsGuSH69fYfPJCBKBrbPCxYFQ== +"@typescript-eslint/types@5.46.0": + version "5.46.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.46.0.tgz#f4d76622a996b88153bbd829ea9ccb9f7a5d28bc" + integrity sha512-wHWgQHFB+qh6bu0IAPAJCdeCdI0wwzZnnWThlmHNY01XJ9Z97oKqKOzWYpR2I83QmshhQJl6LDM9TqMiMwJBTw== "@typescript-eslint/typescript-estree@4.33.0": version "4.33.0" @@ -3839,29 +3831,29 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/typescript-estree@5.44.0": - version "5.44.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.44.0.tgz#0461b386203e8d383bb1268b1ed1da9bc905b045" - integrity sha512-M6Jr+RM7M5zeRj2maSfsZK2660HKAJawv4Ud0xT+yauyvgrsHu276VtXlKDFnEmhG+nVEd0fYZNXGoAgxwDWJw== +"@typescript-eslint/typescript-estree@5.46.0": + version "5.46.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.46.0.tgz#a6c2b84b9351f78209a1d1f2d99ca553f7fa29a5" + integrity sha512-kDLNn/tQP+Yp8Ro2dUpyyVV0Ksn2rmpPpB0/3MO874RNmXtypMwSeazjEN/Q6CTp8D7ExXAAekPEcCEB/vtJkw== dependencies: - "@typescript-eslint/types" "5.44.0" - "@typescript-eslint/visitor-keys" "5.44.0" + "@typescript-eslint/types" "5.46.0" + "@typescript-eslint/visitor-keys" "5.46.0" debug "^4.3.4" globby "^11.1.0" is-glob "^4.0.3" semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/utils@5.44.0": - version "5.44.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.44.0.tgz#d733da4d79d6c30f1a68b531cdda1e0c1f00d52d" - integrity sha512-fMzA8LLQ189gaBjS0MZszw5HBdZgVwxVFShCO3QN+ws3GlPkcy9YuS3U4wkT6su0w+Byjq3mS3uamy9HE4Yfjw== +"@typescript-eslint/utils@5.46.0": + version "5.46.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.46.0.tgz#600cd873ba471b7d8b0b9f35de34cf852c6fcb31" + integrity sha512-4O+Ps1CRDw+D+R40JYh5GlKLQERXRKW5yIQoNDpmXPJ+C7kaPF9R7GWl+PxGgXjB3PQCqsaaZUpZ9dG4U6DO7g== dependencies: "@types/json-schema" "^7.0.9" "@types/semver" "^7.3.12" - "@typescript-eslint/scope-manager" "5.44.0" - "@typescript-eslint/types" "5.44.0" - "@typescript-eslint/typescript-estree" "5.44.0" + "@typescript-eslint/scope-manager" "5.46.0" + "@typescript-eslint/types" "5.46.0" + "@typescript-eslint/typescript-estree" "5.46.0" eslint-scope "^5.1.1" eslint-utils "^3.0.0" semver "^7.3.7" @@ -3874,12 +3866,12 @@ "@typescript-eslint/types" "4.33.0" eslint-visitor-keys "^2.0.0" -"@typescript-eslint/visitor-keys@5.44.0": - version "5.44.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.44.0.tgz#10740dc28902bb903d12ee3a005cc3a70207d433" - integrity sha512-a48tLG8/4m62gPFbJ27FxwCOqPKxsb8KC3HkmYoq2As/4YyjQl1jDbRr1s63+g4FS/iIehjmN3L5UjmKva1HzQ== +"@typescript-eslint/visitor-keys@5.46.0": + version "5.46.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.46.0.tgz#36d87248ae20c61ef72404bcd61f14aa2563915f" + integrity sha512-E13gBoIXmaNhwjipuvQg1ByqSAu/GbEpP/qzFihugJ+MomtoJtFAJG/+2DRPByf57B863m0/q7Zt16V9ohhANw== dependencies: - "@typescript-eslint/types" "5.44.0" + "@typescript-eslint/types" "5.46.0" eslint-visitor-keys "^3.3.0" "@vercel/webpack-asset-relocator-loader@^1.7.0": @@ -5263,7 +5255,7 @@ chardet@^0.7.0: resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== -chart.js@^3.4.0, chart.js@^3.9.1: +chart.js@3.9.1, chart.js@^3.4.0: version "3.9.1" resolved "https://registry.yarnpkg.com/chart.js/-/chart.js-3.9.1.tgz#3abf2c775169c4c71217a107163ac708515924b8" integrity sha512-Ro2JbLmvg83gXF5F4sniaQ+lTbSv18E+TIf2cOeiH1Iqd2PGFOtem+DUufMZsCJwFE7ywPOpfXFBwRTGq7dh6w== @@ -7112,10 +7104,10 @@ eslint-webpack-plugin@^2.7.0: normalize-path "^3.0.0" schema-utils "^3.1.1" -eslint@8.28.0: - version "8.28.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.28.0.tgz#81a680732634677cc890134bcdd9fdfea8e63d6e" - integrity sha512-S27Di+EVyMxcHiwDrFzk8dJYAaD+/5SoWKxL1ri/71CRHsnJnRDPNt2Kzj24+MT9FDupf4aqqyqPrvI8MvQ4VQ== +eslint@8.29.0: + version "8.29.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.29.0.tgz#d74a88a20fb44d59c51851625bc4ee8d0ec43f87" + integrity sha512-isQ4EEiyUjZFbEKvEGJKKGBwXtvXX+zJbkVKCgTuB9t/+jUBcy8avhkEwWJecI15BkRkOYmvIM5ynbhRjEkoeg== dependencies: "@eslint/eslintrc" "^1.3.3" "@humanwhocodes/config-array" "^0.11.6" @@ -7250,11 +7242,6 @@ estraverse@^5.1.0, estraverse@^5.2.0, estraverse@^5.3.0: resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== -estree-walker@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-1.0.1.tgz#31bc5d612c96b704106b477e6dd5d8aa138cb700" - integrity sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg== - estree-walker@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac" @@ -12587,7 +12574,7 @@ picocolors@^1.0.0: resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== -picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.2, picomatch@^2.2.3, picomatch@^2.3.1: +picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3, picomatch@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== @@ -12958,10 +12945,10 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" -prettier@^2.7.1: - version "2.8.0" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.0.tgz#c7df58393c9ba77d6fba3921ae01faf994fb9dc9" - integrity sha512-9Lmg8hTFZKG0Asr/kW9Bp8tJjRVluO8EJQVfY2T7FMw9T5jy4I/Uvx0Rca/XWf50QQ1/SS48+6IJWnrb+2yemA== +prettier@^2.8.1: + version "2.8.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.1.tgz#4e1fd11c34e2421bc1da9aea9bd8127cd0a35efc" + integrity sha512-lqGoSJBQNJidqCHE80vqZJHWHRFoNYsSpP9AjFhlhi9ODCJA541svILes/+/1GM3VaL/abZi7cpFzOpdR9UPKg== pretty-bytes@^5.1.0, pretty-bytes@^5.3.0, pretty-bytes@^5.4.1: version "5.6.0" @@ -13877,7 +13864,7 @@ resolve.exports@^1.1.0: resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-1.1.0.tgz#5ce842b94b05146c0e03076985d1d0e7e48c90c9" integrity sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ== -resolve@^1.10.0, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.19.0, resolve@^1.20.0, resolve@^1.22.0, resolve@^1.22.1, resolve@^1.3.2: +resolve@^1.10.0, resolve@^1.14.2, resolve@^1.19.0, resolve@^1.20.0, resolve@^1.22.0, resolve@^1.22.1, resolve@^1.3.2: version "1.22.1" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177" integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== @@ -13969,10 +13956,10 @@ rollup-plugin-import-css@^3.0.3: dependencies: "@rollup/pluginutils" "^5.0.2" -rollup@^3.4.0: - version "3.4.0" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-3.4.0.tgz#3f363d46474deb54e6da38d398c3af845c1b7d43" - integrity sha512-4g8ZrEFK7UbDvy3JF+d5bLiC8UKkS3n/27/cnVeESwB1LVPl6MoPL32/6+SCQ1vHTp6Mvp2veIHtwELhi+uXEw== +rollup@^3.7.2: + version "3.7.2" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-3.7.2.tgz#221d3bb567ec622c5347e6adf689bef9d3715c3f" + integrity sha512-orqIX5zkHyHKVsIBl8J5a2tnVikOAMte0DgOLViyW6McYuj45FG+cQPrXILhaifBSmy0D0hKbHg2RbgzFJcwTg== optionalDependencies: fsevents "~2.3.2" @@ -15428,10 +15415,10 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA== -typescript@^4.9.3: - version "4.9.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.3.tgz#3aea307c1746b8c384435d8ac36b8a2e580d85db" - integrity sha512-CIfGzTelbKNEnLpLdGFgdyKhG23CKdKgQPOBc+OUNrkJ2vr+KSzsSV5kq5iWhEQbok+quxgGzrAtGWCyU7tHnA== +typescript@^4.9.4: + version "4.9.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.4.tgz#a2a3d2756c079abda241d75f149df9d561091e78" + integrity sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg== ua-parser-js@^0.7.30: version "0.7.32" From 7c60c9d2b8a103c56c3db6547db666f6c46f02a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Holeczek?= Date: Sat, 10 Dec 2022 15:39:28 +0100 Subject: [PATCH 005/476] chore: update dependencies and devDependencies --- packages/docs/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/docs/package.json b/packages/docs/package.json index d187a425..58b30935 100644 --- a/packages/docs/package.json +++ b/packages/docs/package.json @@ -60,7 +60,7 @@ "react-helmet": "^6.1.0", "remark-html": "^13.0.2", "rimraf": "^3.0.2", - "sass": "^1.54.2" + "sass": "^1.56.2" }, "devDependencies": { "npm-run-all": "^4.1.5" From 4e892408d893d5dfe29086f8664ff2d416494d72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Holeczek?= Date: Sat, 10 Dec 2022 16:03:27 +0100 Subject: [PATCH 006/476] refactor(CFormRange): make the `steps` property optional --- packages/coreui-react/src/components/form/CFormRange.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/coreui-react/src/components/form/CFormRange.tsx b/packages/coreui-react/src/components/form/CFormRange.tsx index ce11ce5a..2ced26fe 100644 --- a/packages/coreui-react/src/components/form/CFormRange.tsx +++ b/packages/coreui-react/src/components/form/CFormRange.tsx @@ -38,7 +38,7 @@ export interface CFormRangeProps extends InputHTMLAttributes { /** * Specifies the interval between legal numbers in the component. */ - steps: number + steps?: number /** * The `value` attribute of component. * From fb1b219ef4a70733e3586ae5fef3a0c408d90aa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Holeczek?= Date: Sat, 10 Dec 2022 16:12:41 +0100 Subject: [PATCH 007/476] fix(CFormRange): change the wrong property name `steps` to `step` --- packages/coreui-react/src/components/form/CFormRange.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/coreui-react/src/components/form/CFormRange.tsx b/packages/coreui-react/src/components/form/CFormRange.tsx index 2ced26fe..2d20762d 100644 --- a/packages/coreui-react/src/components/form/CFormRange.tsx +++ b/packages/coreui-react/src/components/form/CFormRange.tsx @@ -38,7 +38,7 @@ export interface CFormRangeProps extends InputHTMLAttributes { /** * Specifies the interval between legal numbers in the component. */ - steps?: number + step?: number /** * The `value` attribute of component. * From 1098ea83871e7a839d369afabd0911196966ba2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Holeczek?= Date: Sat, 10 Dec 2022 16:20:21 +0100 Subject: [PATCH 008/476] docs: update examples --- packages/docs/content/4.4/api/CChart.api.mdx | 4 +- packages/docs/content/4.4/api/CCharts.api.mdx | 1 - .../docs/content/4.4/api/CFormRange.api.mdx | 2 +- .../docs/content/4.4/components/alert.mdx | 4 +- .../docs/content/4.4/components/table.mdx | 42 +++++++++---------- .../docs/content/4.4/forms/form-control.mdx | 6 +-- packages/docs/content/4.4/forms/range.mdx | 10 ++--- packages/docs/content/4.4/forms/textarea.mdx | 6 +-- 8 files changed, 37 insertions(+), 38 deletions(-) diff --git a/packages/docs/content/4.4/api/CChart.api.mdx b/packages/docs/content/4.4/api/CChart.api.mdx index b1f27095..20fd8d27 100644 --- a/packages/docs/content/4.4/api/CChart.api.mdx +++ b/packages/docs/content/4.4/api/CChart.api.mdx @@ -17,8 +17,8 @@ import CChart from '@coreui/react-chartjs/src/CChart' | **height** | Height attribute applied to the rendered canvas. | `number` | 150 | | **id** | ID attribute applied to the rendered canvas. | `string` | - | | **options** | The options object that is passed into the Chart.js chart.

{@link https://www.chartjs.org/docs/latest/general/options.html More Info} | `_DeepPartialObject & ElementChartOptions & PluginChartOptions<...> & DatasetChartOptions<...> & ScaleChartOptions<...>>` | - | -| **plugins** | The plugins array that is passed into the Chart.js chart (more info)

{@link https://www.chartjs.org/docs/latest/developers/plugins.html More Info} | `Plugin[]` | - | +| **plugins** | The plugins array that is passed into the Chart.js chart (more info)

{@link https://www.chartjs.org/docs/latest/developers/plugins.html More Info} | `Plugin[]` | [] | | **redraw** | If true, will tear down and redraw chart on all updates. | `boolean` | false | -| **type** | Chart.js chart type. | `{'line'` \| `'bar'` \| `'radar'` \| `'doughnut'` \| `'polarArea'` \| `'bubble'` \| `'pie'` \| `'scatter'}` | - | +| **type** | Chart.js chart type. | `{'line'` \| `'bar'` \| `'radar'` \| `'doughnut'` \| `'polarArea'` \| `'bubble'` \| `'pie'` \| `'scatter'}` | bar | | **width** | Width attribute applied to the rendered canvas. | `number` | 300 | | **wrapper** | Put the chart into the wrapper div element. | `boolean` | true | diff --git a/packages/docs/content/4.4/api/CCharts.api.mdx b/packages/docs/content/4.4/api/CCharts.api.mdx index e8da85ee..fdad3ee8 100644 --- a/packages/docs/content/4.4/api/CCharts.api.mdx +++ b/packages/docs/content/4.4/api/CCharts.api.mdx @@ -19,6 +19,5 @@ import CChartBar from '@coreui/react-chartjs/src/CCharts' | **options** | The options object that is passed into the Chart.js chart.

{@link https://www.chartjs.org/docs/latest/general/options.html More Info} | `_DeepPartialObject & ElementChartOptions & PluginChartOptions<...> & DatasetChartOptions<...> & ScaleChartOptions<...>>` | - | | **plugins** | The plugins array that is passed into the Chart.js chart (more info)

{@link https://www.chartjs.org/docs/latest/developers/plugins.html More Info} | `Plugin[]` | - | | **redraw** | If true, will tear down and redraw chart on all updates. | `boolean` | false | -| **type** | Chart.js chart type. | `{'line'` \| `'bar'` \| `'radar'` \| `'doughnut'` \| `'polarArea'` \| `'bubble'` \| `'pie'` \| `'scatter'}` | - | | **width** | Width attribute applied to the rendered canvas. | `number` | 300 | | **wrapper** | Put the chart into the wrapper div element. | `boolean` | true | diff --git a/packages/docs/content/4.4/api/CFormRange.api.mdx b/packages/docs/content/4.4/api/CFormRange.api.mdx index 11ff574a..b7310578 100644 --- a/packages/docs/content/4.4/api/CFormRange.api.mdx +++ b/packages/docs/content/4.4/api/CFormRange.api.mdx @@ -14,5 +14,5 @@ import CFormRange from '@coreui/react/src/components/form/CFormRange' | **min** | Specifies the minimum value for the component. | `number` | - | | **onChange** | Method called immediately after the `value` prop changes. | `ChangeEventHandler` | - | | **readOnly** | Toggle the readonly state for the component. | `boolean` | - | -| **steps** | Specifies the interval between legal numbers in the component. | `number` | - | +| **step** | Specifies the interval between legal numbers in the component. | `number` | - | | **value** | The `value` attribute of component. | `string` \| `number` \| `string[]` | - | diff --git a/packages/docs/content/4.4/components/alert.mdx b/packages/docs/content/4.4/components/alert.mdx index f17bc62f..33e857dd 100644 --- a/packages/docs/content/4.4/components/alert.mdx +++ b/packages/docs/content/4.4/components/alert.mdx @@ -177,7 +177,7 @@ React Alert can also incorporate supplementary components & elements like he - Well done! + Well done!

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


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

@@ -186,7 +186,7 @@ React Alert can also incorporate supplementary components & elements like he ```jsx - Well done! + Well done!

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


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

diff --git a/packages/docs/content/4.4/components/table.mdx b/packages/docs/content/4.4/components/table.mdx index d771406c..b6d8428f 100644 --- a/packages/docs/content/4.4/components/table.mdx +++ b/packages/docs/content/4.4/components/table.mdx @@ -152,7 +152,7 @@ You can also put all table components together manually as hitherto. 3 - Larry the Bird + Larry the Bird @twitter @@ -407,7 +407,7 @@ Use `striped` property to add zebra-striping to any react table row within the ` 3 - Larry the Bird + Larry the Bird @twitter @@ -449,7 +449,7 @@ Use `stripedColumns` boolean property to add zebra-striping to any table column. 3 - Larry the Bird + Larry the Bird @twitter @@ -489,7 +489,7 @@ These classes can also be added to react table variants: 3 - Larry the Bird + Larry the Bird @twitter @@ -527,7 +527,7 @@ These classes can also be added to react table variants: 3 - Larry the Bird + Larry the Bird @twitter @@ -565,7 +565,7 @@ These classes can also be added to react table variants: 3 - Larry the Bird + Larry the Bird @twitter @@ -603,7 +603,7 @@ These classes can also be added to react table variants: 3 - Larry the Bird + Larry the Bird @twitter @@ -645,7 +645,7 @@ Use `hover` property to enable a hover state on react table rows within a ` 3 - Larry the Bird + Larry the Bird @twitter @@ -683,7 +683,7 @@ Use `hover` property to enable a hover state on react table rows within a ` 3 - Larry the Bird + Larry the Bird @twitter @@ -723,7 +723,7 @@ These hoverable rows can also be combined with the striped variant: 3 - Larry the Bird + Larry the Bird @twitter @@ -867,7 +867,7 @@ return 3 - + Larry the Bird @twitter @@ -1007,7 +1007,7 @@ Add `bordered` property for borders on all sides of the table and cells. 3 - Larry the Bird + Larry the Bird @twitter @@ -1047,7 +1047,7 @@ Add `bordered` property for borders on all sides of the table and cells. 3 - Larry the Bird + Larry the Bird @twitter @@ -1089,7 +1089,7 @@ Add `borderless` property for a react table without borders. 3 - Larry the Bird + Larry the Bird @twitter @@ -1127,7 +1127,7 @@ Add `borderless` property for a react table without borders. 3 - Larry the Bird + Larry the Bird @twitter @@ -1169,7 +1169,7 @@ Add `small` property to make any `` more compact by cutting all cell `pa 3 - Larry the Bird + Larry the Bird @twitter @@ -1370,7 +1370,7 @@ Border styles, active styles, and react table component variants are not inherit @mdo - + @@ -1401,7 +1401,7 @@ Border styles, active styles, and react table component variants are not inherit 3 - Larry the Bird + Larry the Bird @twitter @@ -1426,7 +1426,7 @@ Border styles, active styles, and react table component variants are not inherit @mdo - + @@ -1457,7 +1457,7 @@ Border styles, active styles, and react table component variants are not inherit 3 - Larry the Bird + Larry the Bird @twitter @@ -1566,7 +1566,7 @@ return 3 - Larry the Bird + Larry the Bird @twitter diff --git a/packages/docs/content/4.4/forms/form-control.mdx b/packages/docs/content/4.4/forms/form-control.mdx index 14184d86..454ab463 100644 --- a/packages/docs/content/4.4/forms/form-control.mdx +++ b/packages/docs/content/4.4/forms/form-control.mdx @@ -26,7 +26,7 @@ import {
Example textarea - +
@@ -35,7 +35,7 @@ import {
Example textarea - +
@@ -48,7 +48,7 @@ import {
Example textarea - +
``` diff --git a/packages/docs/content/4.4/forms/range.mdx b/packages/docs/content/4.4/forms/range.mdx index 9fe4ecce..1f8fc31c 100644 --- a/packages/docs/content/4.4/forms/range.mdx +++ b/packages/docs/content/4.4/forms/range.mdx @@ -38,23 +38,23 @@ Add the `disabled` boolean attribute on an input to give it a grayed out appeara Range inputs have implicit values for `min` and `max`—`0` and `100`, respectively. You may specify new values for those using the `min` and `max` attributes. - + ```jsx - + ``` ## Steps -By default, range inputs "snap" to integer values. To change this, you can specify a `step` value. In the example below, we double the number of steps by using `step="0.5"`. +By default, range inputs "snap" to integer values. To change this, you can specify a `step` value. In the example below, we double the number of steps by using `step={0.5}`. - + ```jsx - + ``` ## API diff --git a/packages/docs/content/4.4/forms/textarea.mdx b/packages/docs/content/4.4/forms/textarea.mdx index 725b891b..06f9adb5 100644 --- a/packages/docs/content/4.4/forms/textarea.mdx +++ b/packages/docs/content/4.4/forms/textarea.mdx @@ -25,7 +25,7 @@ import { @@ -35,7 +35,7 @@ import { @@ -45,7 +45,7 @@ If you need to add custom classNames to form's components, or need to add some c ```jsx Example textarea - + Must be 8-20 words long. ``` From 71dff1d541cf3edf38aea5ec62cd679b62dbe4ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Holeczek?= Date: Sat, 10 Dec 2022 17:17:28 +0100 Subject: [PATCH 009/476] refactor(CButton, CHeaderBrand, CLink, ClistGroupItem): update interface --- packages/coreui-react/src/components/button/CButton.tsx | 6 +++--- .../coreui-react/src/components/header/CHeaderBrand.tsx | 5 +++-- packages/coreui-react/src/components/link/CLink.tsx | 4 ++-- .../src/components/list-group/CListGroupItem.tsx | 4 ++-- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/packages/coreui-react/src/components/button/CButton.tsx b/packages/coreui-react/src/components/button/CButton.tsx index 91ffce22..543ea4aa 100644 --- a/packages/coreui-react/src/components/button/CButton.tsx +++ b/packages/coreui-react/src/components/button/CButton.tsx @@ -1,11 +1,11 @@ -import React, { ButtonHTMLAttributes, ElementType, forwardRef } from 'react' +import React, { ElementType, forwardRef } from 'react' import PropTypes from 'prop-types' import classNames from 'classnames' import { Colors, Shapes, colorPropType } from '../Types' -import { CLink } from '../link/CLink' +import { CLink, CLinkProps } from '../link/CLink' -export interface CButtonProps extends ButtonHTMLAttributes { +export interface CButtonProps extends Omit { /** * Toggle the active state for the component. */ diff --git a/packages/coreui-react/src/components/header/CHeaderBrand.tsx b/packages/coreui-react/src/components/header/CHeaderBrand.tsx index 85108696..d8acd335 100644 --- a/packages/coreui-react/src/components/header/CHeaderBrand.tsx +++ b/packages/coreui-react/src/components/header/CHeaderBrand.tsx @@ -1,8 +1,9 @@ -import React, { ElementType, forwardRef, HTMLAttributes } from 'react' +import React, { ElementType, forwardRef, AnchorHTMLAttributes } from 'react' import PropTypes from 'prop-types' import classNames from 'classnames' -export interface CHeaderBrandProps extends HTMLAttributes { +export interface CHeaderBrandProps + extends AnchorHTMLAttributes { /** * A string of all className you want applied to the component. */ diff --git a/packages/coreui-react/src/components/link/CLink.tsx b/packages/coreui-react/src/components/link/CLink.tsx index 8aec4546..c4d2a3f9 100644 --- a/packages/coreui-react/src/components/link/CLink.tsx +++ b/packages/coreui-react/src/components/link/CLink.tsx @@ -2,7 +2,7 @@ import React, { AllHTMLAttributes, ElementType, forwardRef, MouseEvent } from 'r import PropTypes from 'prop-types' import classNames from 'classnames' -export interface CLinkProps extends AllHTMLAttributes { +export interface CLinkProps extends AllHTMLAttributes { /** * Toggle the active state for the component. */ @@ -36,7 +36,7 @@ export const CLink = forwardRef) => { + onClick: (event: MouseEvent) => { event.preventDefault !disabled && rest.onClick && rest.onClick(event) }, diff --git a/packages/coreui-react/src/components/list-group/CListGroupItem.tsx b/packages/coreui-react/src/components/list-group/CListGroupItem.tsx index f31b5b0a..68610c02 100644 --- a/packages/coreui-react/src/components/list-group/CListGroupItem.tsx +++ b/packages/coreui-react/src/components/list-group/CListGroupItem.tsx @@ -1,4 +1,4 @@ -import React, { ElementType, HTMLAttributes, forwardRef } from 'react' +import React, { ElementType, AnchorHTMLAttributes, forwardRef } from 'react' import PropTypes from 'prop-types' import classNames from 'classnames' @@ -6,7 +6,7 @@ import { Colors, colorPropType } from '../Types' import { CLink } from '../link/CLink' export interface CListGroupItemProps - extends HTMLAttributes { + extends AnchorHTMLAttributes { /** * Toggle the active state for the component. */ From 2e48f7b65295153794e20238aa60c1120dbf51d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Holeczek?= Date: Sun, 11 Dec 2022 21:30:35 +0100 Subject: [PATCH 010/476] refactor(CInputGroupText): update interface --- .../coreui-react/src/components/form/CInputGroupText.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/coreui-react/src/components/form/CInputGroupText.tsx b/packages/coreui-react/src/components/form/CInputGroupText.tsx index 4b23bd8e..d7a4008c 100644 --- a/packages/coreui-react/src/components/form/CInputGroupText.tsx +++ b/packages/coreui-react/src/components/form/CInputGroupText.tsx @@ -1,8 +1,9 @@ -import React, { ElementType, forwardRef, HTMLAttributes } from 'react' +import React, { ElementType, forwardRef, LabelHTMLAttributes } from 'react' import PropTypes from 'prop-types' import classNames from 'classnames' -export interface CInputGroupTextProps extends HTMLAttributes { +export interface CInputGroupTextProps + extends LabelHTMLAttributes { /** * A string of all className you want applied to the component. */ From f455aab6794200cc508bd0d6fa9dce744bd0f5b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Holeczek?= Date: Sun, 11 Dec 2022 21:30:54 +0100 Subject: [PATCH 011/476] tests: update tests --- .../src/components/form/__tests__/CFormRange.spec.tsx | 4 ++-- .../form/__tests__/CInputGroupText.spec.tsx | 9 +++++++++ .../__snapshots__/CInputGroupText.spec.tsx.snap | 11 +++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/packages/coreui-react/src/components/form/__tests__/CFormRange.spec.tsx b/packages/coreui-react/src/components/form/__tests__/CFormRange.spec.tsx index a7c5ad71..efe651a6 100644 --- a/packages/coreui-react/src/components/form/__tests__/CFormRange.spec.tsx +++ b/packages/coreui-react/src/components/form/__tests__/CFormRange.spec.tsx @@ -4,7 +4,7 @@ import '@testing-library/jest-dom/extend-expect' import { CFormRange } from '../../../index' test('loads and displays CFormRange component', async () => { - const { container } = render() + const { container } = render() expect(container).toMatchSnapshot() }) @@ -12,7 +12,7 @@ test('CFormRange customize', async () => { const { container } = render( { 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() 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 index 851ccb62..00ae0e56 100644 --- 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 @@ -19,3 +19,14 @@ exports[`loads and displays CInputGroupText component 1`] = ` `; + +exports[`renders CInputGroupText component as a label 1`] = ` +
+ +
+`; From 39c0fac165938d4ffefd5a077cb99b6c985543ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Holeczek?= Date: Mon, 12 Dec 2022 12:17:20 +0100 Subject: [PATCH 012/476] refactor(CFormLabel): update interface --- packages/coreui-react/src/components/form/CFormLabel.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/coreui-react/src/components/form/CFormLabel.tsx b/packages/coreui-react/src/components/form/CFormLabel.tsx index ef4b3b2b..dad52650 100644 --- a/packages/coreui-react/src/components/form/CFormLabel.tsx +++ b/packages/coreui-react/src/components/form/CFormLabel.tsx @@ -1,8 +1,8 @@ -import React, { forwardRef, AllHTMLAttributes } from 'react' +import React, { forwardRef, LabelHTMLAttributes } from 'react' import PropTypes from 'prop-types' import classNames from 'classnames' -export interface CFormLabelProps extends AllHTMLAttributes { +export interface CFormLabelProps extends LabelHTMLAttributes { /** * A string of all className you want applied to the component. */ From 7a73db1f6c486c294f9acd364592a0c6d984f99b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Holeczek?= Date: Mon, 12 Dec 2022 14:00:21 +0100 Subject: [PATCH 013/476] refactor(CToastClose): update interface --- packages/coreui-react/src/components/toast/CToastClose.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/coreui-react/src/components/toast/CToastClose.tsx b/packages/coreui-react/src/components/toast/CToastClose.tsx index f21a934a..f944f7f1 100644 --- a/packages/coreui-react/src/components/toast/CToastClose.tsx +++ b/packages/coreui-react/src/components/toast/CToastClose.tsx @@ -3,7 +3,10 @@ import PropTypes from 'prop-types' import { CToastContext } from './CToast' import { CCloseButton, CCloseButtonProps } from '../close-button/CCloseButton' -export interface CToastCloseProps extends CCloseButtonProps { +import type { CButtonProps } from '../button/CButton' + +type CombineButtonProps = CCloseButtonProps & CButtonProps +export interface CToastCloseProps extends CombineButtonProps { /** * Component used for the root node. Either a string to use a HTML element or a component. */ From ee2e6e5ad82f050bce4cdd9a2dc4fd7c2145835e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Holeczek?= Date: Mon, 12 Dec 2022 14:00:54 +0100 Subject: [PATCH 014/476] docs: update styles --- packages/docs/src/styles/_example.scss | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/docs/src/styles/_example.scss b/packages/docs/src/styles/_example.scss index 8e2dc13b..22dc00ff 100644 --- a/packages/docs/src/styles/_example.scss +++ b/packages/docs/src/styles/_example.scss @@ -180,6 +180,11 @@ margin-top: .5rem; margin-bottom: .5rem; } + + // Toast + .toast-container { + position: relative !important; + } } // Ratio helpers From 3599ea5a403d6ed6302754e90aba296db1db708c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Holeczek?= Date: Mon, 12 Dec 2022 15:27:09 +0100 Subject: [PATCH 015/476] release: @coreui/react-chartjs@2.1.1 --- packages/coreui-react-chartjs/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/coreui-react-chartjs/package.json b/packages/coreui-react-chartjs/package.json index 23567ccf..23a01f28 100644 --- a/packages/coreui-react-chartjs/package.json +++ b/packages/coreui-react-chartjs/package.json @@ -1,6 +1,6 @@ { "name": "@coreui/react-chartjs", - "version": "2.1.0", + "version": "2.1.1", "description": "React wrapper component for Chart.js", "keywords": [ "coreui", From 1860d7487b12898b7bd5315cfe6d26476c89eab8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Holeczek?= Date: Mon, 12 Dec 2022 19:30:55 +0100 Subject: [PATCH 016/476] chore: update dependencies and devDependencies --- yarn.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/yarn.lock b/yarn.lock index 95798fc1..031f52f7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14017,10 +14017,10 @@ sass-loader@^10.1.1: schema-utils "^3.0.0" semver "^7.3.2" -sass@^1.54.2: - version "1.56.1" - resolved "https://registry.yarnpkg.com/sass/-/sass-1.56.1.tgz#94d3910cd468fd075fa87f5bb17437a0b617d8a7" - integrity sha512-VpEyKpyBPCxE7qGDtOcdJ6fFbcpOM+Emu7uZLxVrkX8KVU/Dp5UF7WLvzqRuUhB6mqqQt1xffLoG+AndxTZrCQ== +sass@^1.56.2: + version "1.56.2" + resolved "https://registry.yarnpkg.com/sass/-/sass-1.56.2.tgz#9433b345ab3872996c82a53a58c014fd244fd095" + integrity sha512-ciEJhnyCRwzlBCB+h5cCPM6ie/6f8HrhZMQOf5vlU60Y1bI1rx5Zb0vlDZvaycHsg/MqFfF1Eq2eokAa32iw8w== dependencies: chokidar ">=3.0.0 <4.0.0" immutable "^4.0.0" From 549be8afb16aa9602ac383f2586707bcd08aa097 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Holeczek?= Date: Mon, 12 Dec 2022 19:32:58 +0100 Subject: [PATCH 017/476] release: v4.4.1 --- README.md | 2 +- packages/coreui-react/README.md | 2 +- packages/coreui-react/package.json | 2 +- packages/docs/package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index da40aca6..2100c5f5 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ Several quick start options are available: -- [Download the latest release](https://github.com/coreui/coreui-react/archive/v4.4.0.zip) +- [Download the latest release](https://github.com/coreui/coreui-react/archive/v4.4.1.zip) - Clone the repo: `git clone https://github.com/coreui/coreui-react.git` - Install with [npm](https://www.npmjs.com/): `npm install @coreui/react` - Install with [yarn](https://yarnpkg.com/): `yarn add @coreui/react` diff --git a/packages/coreui-react/README.md b/packages/coreui-react/README.md index dcaf1cee..ae4075d6 100644 --- a/packages/coreui-react/README.md +++ b/packages/coreui-react/README.md @@ -46,7 +46,7 @@ Several quick start options are available: -- [Download the latest release](https://github.com/coreui/coreui-react/archive/v4.4.0.zip) +- [Download the latest release](https://github.com/coreui/coreui-react/archive/v4.4.1.zip) - Clone the repo: `git clone https://github.com/coreui/coreui-react.git` - Install with [npm](https://www.npmjs.com/): `npm install @coreui/react` - Install with [yarn](https://yarnpkg.com/): `yarn add @coreui/react` diff --git a/packages/coreui-react/package.json b/packages/coreui-react/package.json index 40167626..46dd17ce 100644 --- a/packages/coreui-react/package.json +++ b/packages/coreui-react/package.json @@ -1,6 +1,6 @@ { "name": "@coreui/react", - "version": "4.4.0", + "version": "4.4.1", "description": "UI Components Library for React.js", "keywords": [ "react", diff --git a/packages/docs/package.json b/packages/docs/package.json index 58b30935..ca179798 100644 --- a/packages/docs/package.json +++ b/packages/docs/package.json @@ -1,6 +1,6 @@ { "name": "@coreui/react-docs", - "version": "4.4.0", + "version": "4.4.1", "private": true, "description": "", "homepage": "https://coreui.io/react/", From d8f7e7b2cb8d0df212d5ea66f2bd1e61e924a255 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Holeczek?= Date: Mon, 19 Dec 2022 12:44:55 +0100 Subject: [PATCH 018/476] docs: update documentation --- packages/docs/content/4.4/components/icon.mdx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/docs/content/4.4/components/icon.mdx b/packages/docs/content/4.4/components/icon.mdx index 2383e7df..2d7fa0c8 100644 --- a/packages/docs/content/4.4/components/icon.mdx +++ b/packages/docs/content/4.4/components/icon.mdx @@ -1,7 +1,7 @@ --- -title: React Icon Component +title: React Icons Component name: Icon -description: Official React.js component for CoreUI Icons and CoreUI Icons PRO. +description: React icons is a great resource for React developers, who can use its customizable SVG icons in their applications. It offers an extensive library of icons to choose from, which can be easily inserted into projects with just a few lines of code. Not only that, but users are also able to customize the appearance of these icons by setting various props on them. This provides developers with an efficient and flexible way to integrate useful graphical elements into their webpages without doing any extra work. menu: Components route: /components/icon --- @@ -20,7 +20,7 @@ import * as icon from '@coreui/icons'; ## Installation -If you want to use our icon component and our icons library you have to install two additional packages. +To use React icons in your project, you will need to install it as a dependency: ### Npm @@ -73,9 +73,9 @@ render() { ... ``` -## Available icons +## Available react icons -CoreUI Icons package is delivered with more than 1500 icons in multiple formats SVG, PNG, and Webfonts. CoreUI Icons are beautifully crafted symbols for common actions and items. You can use them in your digital products for web or mobile app. +CoreUI React Icons package is delivered with more than 1500 icons in multiple formats SVG, PNG, and Webfonts. CoreUI Icons are beautifully crafted symbols for common actions and items. You can use them in your digital products for web or mobile app. 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'] @@ -187,6 +187,8 @@ export const TabPanesExample = () => { +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. + ## API ### CIcon From a060bb7b28fa06df4db64a1c07063b6359b0ffd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Holeczek?= Date: Mon, 19 Dec 2022 15:48:07 +0100 Subject: [PATCH 019/476] Update CModal.tsx --- packages/coreui-react/src/components/modal/CModal.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/coreui-react/src/components/modal/CModal.tsx b/packages/coreui-react/src/components/modal/CModal.tsx index 65ae9667..125b2148 100644 --- a/packages/coreui-react/src/components/modal/CModal.tsx +++ b/packages/coreui-react/src/components/modal/CModal.tsx @@ -108,7 +108,7 @@ export const CModal = forwardRef( transition = true, unmountOnClose = true, visible, - ...attributes + ...rest }, ref, ) => { @@ -233,9 +233,10 @@ export const CModal = forwardRef( fullscreen={fullscreen} scrollable={scrollable} size={size} - {...attributes} > - {children} + + {children} + From 9638f40abb0355ba4d9ccb4fbe321be20b340737 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Holeczek?= Date: Mon, 19 Dec 2022 16:59:46 +0100 Subject: [PATCH 020/476] feat(CFormInput, CFormSelect, CFormTextarea): add feedback support to floating labels --- .../components/form/CFormControlWrapper.tsx | 21 ++++++++++++++++++- .../src/components/form/CFormInput.tsx | 2 ++ .../src/components/form/CFormSelect.tsx | 2 ++ .../src/components/form/CFormTextarea.tsx | 2 ++ .../content/4.4/forms/floating-labels.mdx | 4 +++- 5 files changed, 29 insertions(+), 2 deletions(-) diff --git a/packages/coreui-react/src/components/form/CFormControlWrapper.tsx b/packages/coreui-react/src/components/form/CFormControlWrapper.tsx index a6a83fa1..538454a0 100644 --- a/packages/coreui-react/src/components/form/CFormControlWrapper.tsx +++ b/packages/coreui-react/src/components/form/CFormControlWrapper.tsx @@ -12,6 +12,12 @@ export interface CFormControlWrapperProps extends CFormControlValidationProps { * @ignore */ children?: ReactNode + /** + * A string of all className you want applied to the floating label wrapper. + * + * @since 4.3.0 + */ + floatingClassName?: string /** * Provide valuable, actionable valid feedback when using standard HTML form validation which applied two CSS pseudo-classes, `:invalid` and `:valid`. * @@ -42,6 +48,7 @@ export const CFormControlWrapper: FC = ({ feedback, feedbackInvalid, feedbackValid, + floatingClassName, floatingLabel, id, invalid, @@ -51,9 +58,20 @@ export const CFormControlWrapper: FC = ({ valid, }) => { return floatingLabel ? ( - + {children} {label || floatingLabel} + {text && {text}} + ) : ( <> @@ -76,6 +94,7 @@ export const CFormControlWrapper: FC = ({ 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]), diff --git a/packages/coreui-react/src/components/form/CFormInput.tsx b/packages/coreui-react/src/components/form/CFormInput.tsx index 2b6e95ed..2a0f55a0 100644 --- a/packages/coreui-react/src/components/form/CFormInput.tsx +++ b/packages/coreui-react/src/components/form/CFormInput.tsx @@ -58,6 +58,7 @@ export const CFormInput = forwardRef( feedback, feedbackInvalid, feedbackValid, + floatingClassName, floatingLabel, id, invalid, @@ -101,6 +102,7 @@ export const CFormInput = forwardRef( feedback={feedback} feedbackInvalid={feedbackInvalid} feedbackValid={feedbackValid} + floatingClassName={floatingClassName} floatingLabel={floatingLabel} id={id} invalid={invalid} diff --git a/packages/coreui-react/src/components/form/CFormSelect.tsx b/packages/coreui-react/src/components/form/CFormSelect.tsx index 9223413f..121b69f8 100644 --- a/packages/coreui-react/src/components/form/CFormSelect.tsx +++ b/packages/coreui-react/src/components/form/CFormSelect.tsx @@ -52,6 +52,7 @@ export const CFormSelect = forwardRef( feedback, feedbackInvalid, feedbackValid, + floatingClassName, floatingLabel, htmlSize, id, @@ -81,6 +82,7 @@ export const CFormSelect = forwardRef( feedback={feedback} feedbackInvalid={feedbackInvalid} feedbackValid={feedbackValid} + floatingClassName={floatingClassName} floatingLabel={floatingLabel} id={id} invalid={invalid} diff --git a/packages/coreui-react/src/components/form/CFormTextarea.tsx b/packages/coreui-react/src/components/form/CFormTextarea.tsx index 5f4d090b..d336ab82 100644 --- a/packages/coreui-react/src/components/form/CFormTextarea.tsx +++ b/packages/coreui-react/src/components/form/CFormTextarea.tsx @@ -44,6 +44,7 @@ export const CFormTextarea = forwardRef feedback, feedbackInvalid, feedbackValid, + floatingClassName, floatingLabel, id, invalid, @@ -70,6 +71,7 @@ export const CFormTextarea = forwardRef feedback={feedback} feedbackInvalid={feedbackInvalid} feedbackValid={feedbackValid} + floatingClassName={floatingClassName} floatingLabel={floatingLabel} id={id} invalid={invalid} diff --git a/packages/docs/content/4.4/forms/floating-labels.mdx b/packages/docs/content/4.4/forms/floating-labels.mdx index ef5958f6..57aa3641 100644 --- a/packages/docs/content/4.4/forms/floating-labels.mdx +++ b/packages/docs/content/4.4/forms/floating-labels.mdx @@ -95,9 +95,10 @@ Form validation styles also work as expected. Date: Mon, 19 Dec 2022 17:09:37 +0100 Subject: [PATCH 021/476] refactor: move `isVisible()` to utils --- .../src/components/carousel/CCarousel.tsx | 11 +---------- .../coreui-react/src/components/sidebar/CSidebar.tsx | 11 +---------- packages/coreui-react/src/utils/index.ts | 3 +++ packages/coreui-react/src/utils/isVisible.ts | 11 +++++++++++ 4 files changed, 16 insertions(+), 20 deletions(-) create mode 100644 packages/coreui-react/src/utils/index.ts create mode 100644 packages/coreui-react/src/utils/isVisible.ts diff --git a/packages/coreui-react/src/components/carousel/CCarousel.tsx b/packages/coreui-react/src/components/carousel/CCarousel.tsx index ef121972..08818bc2 100644 --- a/packages/coreui-react/src/components/carousel/CCarousel.tsx +++ b/packages/coreui-react/src/components/carousel/CCarousel.tsx @@ -10,18 +10,9 @@ import React, { import PropTypes from 'prop-types' import classNames from 'classnames' +import { isVisible } from '../../utils' import { useForkedRef } from '../../utils/hooks' -const isVisible = (element: HTMLDivElement) => { - const rect = element.getBoundingClientRect() - return ( - rect.top >= 0 && - rect.left >= 0 && - rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && - rect.right <= (window.innerWidth || document.documentElement.clientWidth) - ) -} - export interface CCarouselProps extends HTMLAttributes { /** * index of the active item. diff --git a/packages/coreui-react/src/components/sidebar/CSidebar.tsx b/packages/coreui-react/src/components/sidebar/CSidebar.tsx index eb21eb82..ec897c2d 100644 --- a/packages/coreui-react/src/components/sidebar/CSidebar.tsx +++ b/packages/coreui-react/src/components/sidebar/CSidebar.tsx @@ -3,6 +3,7 @@ import { createPortal } from 'react-dom' import PropTypes from 'prop-types' import classNames from 'classnames' +import { isVisible } from '../../utils' import { useForkedRef } from '../../utils/hooks' import { CBackdrop } from '../backdrop/CBackdrop' @@ -52,16 +53,6 @@ export interface CSidebarProps extends HTMLAttributes { const isOnMobile = (element: HTMLDivElement) => Boolean(getComputedStyle(element).getPropertyValue('--cui-is-mobile')) -const isVisible = (element: HTMLDivElement) => { - const rect = element.getBoundingClientRect() - return ( - rect.top >= 0 && - rect.left >= 0 && - rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && - rect.right <= (window.innerWidth || document.documentElement.clientWidth) - ) -} - export const CSidebar = forwardRef( ( { diff --git a/packages/coreui-react/src/utils/index.ts b/packages/coreui-react/src/utils/index.ts new file mode 100644 index 00000000..ac72a6ad --- /dev/null +++ b/packages/coreui-react/src/utils/index.ts @@ -0,0 +1,3 @@ +import isVisible from './isVisible' + +export { isVisible } diff --git a/packages/coreui-react/src/utils/isVisible.ts b/packages/coreui-react/src/utils/isVisible.ts new file mode 100644 index 00000000..0bf5cb30 --- /dev/null +++ b/packages/coreui-react/src/utils/isVisible.ts @@ -0,0 +1,11 @@ +const isVisible = (element: HTMLElement) => { + const rect = element.getBoundingClientRect() + return ( + rect.top >= 0 && + rect.left >= 0 && + rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && + rect.right <= (window.innerWidth || document.documentElement.clientWidth) + ) +} + +export default isVisible From 9fb77770fd8889c8f4c1e4b1ea462fdafef91edc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Holeczek?= Date: Mon, 19 Dec 2022 17:48:29 +0100 Subject: [PATCH 022/476] feat(CCarousel): add swipe interactions on touchscreen devices --- .../src/components/carousel/CCarousel.tsx | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/packages/coreui-react/src/components/carousel/CCarousel.tsx b/packages/coreui-react/src/components/carousel/CCarousel.tsx index 08818bc2..9a6234e9 100644 --- a/packages/coreui-react/src/components/carousel/CCarousel.tsx +++ b/packages/coreui-react/src/components/carousel/CCarousel.tsx @@ -3,6 +3,7 @@ import React, { createContext, forwardRef, HTMLAttributes, + TouchEvent, useState, useEffect, useRef, @@ -50,6 +51,12 @@ export interface CCarouselProps extends HTMLAttributes { * 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' + /** + * Whether the carousel should support left/right swipe interactions on touchscreen devices. + * + * @since 4.5.0 + */ + touch?: boolean /** * Set type of the transition. */ @@ -84,6 +91,7 @@ export const CCarousel = forwardRef( onSlid, onSlide, pause = 'hover', + touch = true, transition, wrap = true, ...rest @@ -99,6 +107,7 @@ export const CCarousel = forwardRef( const [customInterval, setCustomInterval] = useState() const [direction, setDirection] = useState('next') const [itemsNumber, setItemsNumber] = useState(0) + const [touchPosition, setTouchPosition] = useState(null) const [visible, setVisible] = useState() useEffect(() => { @@ -193,11 +202,38 @@ export const CCarousel = forwardRef( } } + 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 (
@@ -262,6 +298,7 @@ CCarousel.propTypes = { onSlid: PropTypes.func, onSlide: PropTypes.func, pause: PropTypes.oneOf([false, 'hover']), + touch: PropTypes.bool, transition: PropTypes.oneOf(['slide', 'crossfade']), wrap: PropTypes.bool, } From d26aa5f1deee8b976584e792d71bbe1d160407f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Holeczek?= Date: Mon, 19 Dec 2022 17:57:48 +0100 Subject: [PATCH 023/476] docs: update API documentation --- packages/coreui-react/src/components/carousel/CCarousel.tsx | 2 +- .../src/components/form/CFormControlWrapper.tsx | 2 +- packages/docs/content/4.4/api/CCarousel.api.mdx | 1 + packages/docs/content/4.4/api/CFormControlWrapper.api.mdx | 1 + packages/docs/content/4.4/api/CFormInput.api.mdx | 1 + packages/docs/content/4.4/api/CFormSelect.api.mdx | 1 + packages/docs/content/4.4/api/CFormTextarea.api.mdx | 1 + packages/docs/content/4.4/api/CToastClose.api.mdx | 6 ++++++ 8 files changed, 13 insertions(+), 2 deletions(-) diff --git a/packages/coreui-react/src/components/carousel/CCarousel.tsx b/packages/coreui-react/src/components/carousel/CCarousel.tsx index 9a6234e9..87d1a90a 100644 --- a/packages/coreui-react/src/components/carousel/CCarousel.tsx +++ b/packages/coreui-react/src/components/carousel/CCarousel.tsx @@ -52,7 +52,7 @@ export interface CCarouselProps extends HTMLAttributes { */ pause?: boolean | 'hover' /** - * Whether the carousel should support left/right swipe interactions on touchscreen devices. + * Set whether the carousel should support left/right swipe interactions on touchscreen devices. * * @since 4.5.0 */ diff --git a/packages/coreui-react/src/components/form/CFormControlWrapper.tsx b/packages/coreui-react/src/components/form/CFormControlWrapper.tsx index 538454a0..c74fba26 100644 --- a/packages/coreui-react/src/components/form/CFormControlWrapper.tsx +++ b/packages/coreui-react/src/components/form/CFormControlWrapper.tsx @@ -15,7 +15,7 @@ export interface CFormControlWrapperProps extends CFormControlValidationProps { /** * A string of all className you want applied to the floating label wrapper. * - * @since 4.3.0 + * @since 4.5.0 */ floatingClassName?: string /** diff --git a/packages/docs/content/4.4/api/CCarousel.api.mdx b/packages/docs/content/4.4/api/CCarousel.api.mdx index 0d1bd046..ed3fa126 100644 --- a/packages/docs/content/4.4/api/CCarousel.api.mdx +++ b/packages/docs/content/4.4/api/CCarousel.api.mdx @@ -16,5 +16,6 @@ import CCarousel from '@coreui/react/src/components/carousel/CCarousel' | **onSlid** | Callback fired when a slide transition end. | `(active: number, direction: string) => void` | - | | **onSlide** | Callback fired when a slide transition starts. | `(active: number, direction: string) => void` | - | | **pause** | 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. | `boolean` \| `'hover'` | hover | +| **touch**
4.5.0+
| Set whether the carousel should support left/right swipe interactions on touchscreen devices. | `boolean` | true | | **transition** | Set type of the transition. | `'slide'` \| `'crossfade'` | - | | **wrap** | Set whether the carousel should cycle continuously or have hard stops. | `boolean` | true | diff --git a/packages/docs/content/4.4/api/CFormControlWrapper.api.mdx b/packages/docs/content/4.4/api/CFormControlWrapper.api.mdx index 1578f671..c303da39 100644 --- a/packages/docs/content/4.4/api/CFormControlWrapper.api.mdx +++ b/packages/docs/content/4.4/api/CFormControlWrapper.api.mdx @@ -10,6 +10,7 @@ import CFormControlWrapper from '@coreui/react/src/components/form/CFormControlW | **feedback**
4.2.0+
| Provide valuable, actionable feedback. | `ReactNode` | - | | **feedbackInvalid**
4.2.0+
| Provide valuable, actionable feedback. | `ReactNode` | - | | **feedbackValid**
4.2.0+
| Provide valuable, actionable invalid feedback when using standard HTML form validation which applied two CSS pseudo-classes, `:invalid` and `:valid`. | `ReactNode` | - | +| **floatingClassName**
4.5.0+
| A string of all className you want applied to the floating label wrapper. | `string` | - | | **floatingLabel**
4.2.0+
| Provide valuable, actionable valid feedback when using standard HTML form validation which applied two CSS pseudo-classes, `:invalid` and `:valid`. | `ReactNode` | - | | **invalid** | Set component validation state to invalid. | `boolean` | - | | **label**
4.2.0+
| Add a caption for a component. | `ReactNode` | - | diff --git a/packages/docs/content/4.4/api/CFormInput.api.mdx b/packages/docs/content/4.4/api/CFormInput.api.mdx index d6fe5037..36b44cfd 100644 --- a/packages/docs/content/4.4/api/CFormInput.api.mdx +++ b/packages/docs/content/4.4/api/CFormInput.api.mdx @@ -13,6 +13,7 @@ import CFormInput from '@coreui/react/src/components/form/CFormInput' | **feedback**
4.2.0+
| Provide valuable, actionable feedback. | `ReactNode` | - | | **feedbackInvalid**
4.2.0+
| Provide valuable, actionable feedback. | `ReactNode` | - | | **feedbackValid**
4.2.0+
| Provide valuable, actionable invalid feedback when using standard HTML form validation which applied two CSS pseudo-classes, `:invalid` and `:valid`. | `ReactNode` | - | +| **floatingClassName**
4.5.0+
| A string of all className you want applied to the floating label wrapper. | `string` | - | | **floatingLabel**
4.2.0+
| Provide valuable, actionable valid feedback when using standard HTML form validation which applied two CSS pseudo-classes, `:invalid` and `:valid`. | `ReactNode` | - | | **invalid** | Set component validation state to invalid. | `boolean` | - | | **label**
4.2.0+
| Add a caption for a component. | `ReactNode` | - | diff --git a/packages/docs/content/4.4/api/CFormSelect.api.mdx b/packages/docs/content/4.4/api/CFormSelect.api.mdx index 3ed682ec..9dbafea4 100644 --- a/packages/docs/content/4.4/api/CFormSelect.api.mdx +++ b/packages/docs/content/4.4/api/CFormSelect.api.mdx @@ -11,6 +11,7 @@ import CFormSelect from '@coreui/react/src/components/form/CFormSelect' | **feedback**
4.2.0+
| Provide valuable, actionable feedback. | `ReactNode` | - | | **feedbackInvalid**
4.2.0+
| Provide valuable, actionable feedback. | `ReactNode` | - | | **feedbackValid**
4.2.0+
| Provide valuable, actionable invalid feedback when using standard HTML form validation which applied two CSS pseudo-classes, `:invalid` and `:valid`. | `ReactNode` | - | +| **floatingClassName**
4.5.0+
| A string of all className you want applied to the floating label wrapper. | `string` | - | | **floatingLabel**
4.2.0+
| Provide valuable, actionable valid feedback when using standard HTML form validation which applied two CSS pseudo-classes, `:invalid` and `:valid`. | `ReactNode` | - | | **htmlSize** | Specifies the number of visible options in a drop-down list. | `number` | - | | **invalid** | Set component validation state to invalid. | `boolean` | - | diff --git a/packages/docs/content/4.4/api/CFormTextarea.api.mdx b/packages/docs/content/4.4/api/CFormTextarea.api.mdx index 00f8c4c9..c6fe4065 100644 --- a/packages/docs/content/4.4/api/CFormTextarea.api.mdx +++ b/packages/docs/content/4.4/api/CFormTextarea.api.mdx @@ -12,6 +12,7 @@ import CFormTextarea from '@coreui/react/src/components/form/CFormTextarea' | **feedback**
4.2.0+
| Provide valuable, actionable feedback. | `ReactNode` | - | | **feedbackInvalid**
4.2.0+
| Provide valuable, actionable feedback. | `ReactNode` | - | | **feedbackValid**
4.2.0+
| Provide valuable, actionable invalid feedback when using standard HTML form validation which applied two CSS pseudo-classes, `:invalid` and `:valid`. | `ReactNode` | - | +| **floatingClassName**
4.5.0+
| A string of all className you want applied to the floating label wrapper. | `string` | - | | **floatingLabel**
4.2.0+
| Provide valuable, actionable valid feedback when using standard HTML form validation which applied two CSS pseudo-classes, `:invalid` and `:valid`. | `ReactNode` | - | | **invalid** | Set component validation state to invalid. | `boolean` | - | | **label**
4.2.0+
| Add a caption for a component. | `ReactNode` | - | diff --git a/packages/docs/content/4.4/api/CToastClose.api.mdx b/packages/docs/content/4.4/api/CToastClose.api.mdx index c1357d7a..eba2ff59 100644 --- a/packages/docs/content/4.4/api/CToastClose.api.mdx +++ b/packages/docs/content/4.4/api/CToastClose.api.mdx @@ -7,7 +7,13 @@ import CToastClose from '@coreui/react/src/components/toast/CToastClose' | Property | Description | Type | Default | | --- | --- | --- | --- | +| **active** | Toggle the active state for the component. | `boolean` | - | | **className** | A string of all className you want applied to the base component. | `string` | - | | **component** | Component used for the root node. Either a string to use a HTML element or a component. | `string` \| `ComponentClass` \| `FunctionComponent` | - | | **disabled** | Toggle the disabled state for the component. | `boolean` | - | +| **href** | The href attribute specifies the URL of the page the link goes to. | `string` | - | +| **shape** | Select the shape of the component. | `'rounded'` \| `'rounded-top'` \| `'rounded-end'` \| `'rounded-bottom'` \| `'rounded-start'` \| `'rounded-circle'` \| `'rounded-pill'` \| `'rounded-0'` \| `'rounded-1'` \| `'rounded-2'` \| `'rounded-3'` \| `string` | - | +| **size** | Size the component small or large. | `'sm'` \| `'lg'` | - | +| **type** | Specifies the type of button. Always specify the type attribute for the ` +
+
+

React Modal body text goes here.

+
+
+ + +
+ + + +
+```jsx + React Modal title - React Modal body text goes here. + +

React Modal body text goes here.

+
Close Save changes @@ -58,7 +73,9 @@ export const LiveDemoExample = () => { Modal title - Woohoo, you're reading this text in a modal! + +

Woohoo, you're reading this text in a modal!

+
setVisible(false)}> Close @@ -83,7 +100,9 @@ return ( setVisible(false)}> Modal title - Woohoo, you're reading this text in a modal! + +

Woohoo, you're reading this text in a modal!

+
setVisible(false)}> Close From 81ef1ed7ce06704332002925399bec9e460e9662 Mon Sep 17 00:00:00 2001 From: mrholek Date: Tue, 6 Jun 2023 13:11:15 +0200 Subject: [PATCH 157/476] chore: clean-up --- packages/coreui-react/src/components/popover/CPopover.tsx | 1 - packages/coreui-react/src/components/tooltip/CTooltip.tsx | 1 - 2 files changed, 2 deletions(-) diff --git a/packages/coreui-react/src/components/popover/CPopover.tsx b/packages/coreui-react/src/components/popover/CPopover.tsx index a7408d58..9b887bbf 100644 --- a/packages/coreui-react/src/components/popover/CPopover.tsx +++ b/packages/coreui-react/src/components/popover/CPopover.tsx @@ -51,7 +51,6 @@ export interface CPopoverProps extends Omit, 'tit } const getPlacement = (placement: string, element: HTMLDivElement | null): Placement => { - console.log(element) switch (placement) { case 'right': { return isRTL(element) ? 'left' : 'right' diff --git a/packages/coreui-react/src/components/tooltip/CTooltip.tsx b/packages/coreui-react/src/components/tooltip/CTooltip.tsx index db6e7cea..ae025e44 100644 --- a/packages/coreui-react/src/components/tooltip/CTooltip.tsx +++ b/packages/coreui-react/src/components/tooltip/CTooltip.tsx @@ -47,7 +47,6 @@ export interface CTooltipProps extends Omit, 'con } const getPlacement = (placement: string, element: HTMLDivElement | null): Placement => { - console.log(element) switch (placement) { case 'right': { return isRTL(element) ? 'left' : 'right' From eafc6ceee9a633891edcc3730e06dbd4edca4832 Mon Sep 17 00:00:00 2001 From: mrholek Date: Tue, 6 Jun 2023 14:10:03 +0200 Subject: [PATCH 158/476] refactor(CSpinner): improve class names --- packages/coreui-react/src/components/spinner/CSpinner.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/coreui-react/src/components/spinner/CSpinner.tsx b/packages/coreui-react/src/components/spinner/CSpinner.tsx index c031f08a..81fb7c1e 100644 --- a/packages/coreui-react/src/components/spinner/CSpinner.tsx +++ b/packages/coreui-react/src/components/spinner/CSpinner.tsx @@ -51,8 +51,10 @@ export const CSpinner = forwardRef Date: Tue, 6 Jun 2023 14:17:07 +0200 Subject: [PATCH 159/476] build: update eslint configuration --- .eslintrc.js | 44 +++++++++---------- .../src/components/accordion/index.ts | 8 +--- 2 files changed, 22 insertions(+), 30 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index ade1db98..82fef581 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -18,7 +18,7 @@ module.exports = { 'plugin:react/recommended', 'plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended', - "plugin:unicorn/recommended", + 'plugin:unicorn/recommended', ], parser: '@typescript-eslint/parser', parserOptions: { @@ -36,32 +36,30 @@ module.exports = { }, }, rules: { - "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", + 'unicorn/filename-case': 'off', + 'unicorn/no-array-for-each': 'off', + 'unicorn/no-null': 'off', + 'unicorn/prefer-dom-node-append': 'off', + 'unicorn/prefer-export-from': 'off', + 'unicorn/prefer-query-selector': 'off', + 'unicorn/prevent-abbreviations': 'off', }, overrides: [ { - "files": [ - "packages/docs/build/**" - ], - "env": { - "browser": false, - "node": true + files: ['packages/docs/build/**'], + env: { + browser: false, + node: true, }, - "parserOptions": { - "sourceType": "script" + parserOptions: { + sourceType: 'script', + }, + rules: { + '@typescript-eslint/no-var-requires': 'off', + 'no-console': 'off', + 'unicorn/prefer-module': 'off', + 'unicorn/prefer-top-level-await': 'off', }, - "rules": { - "@typescript-eslint/no-var-requires": "off", - "no-console": "off", - "unicorn/prefer-module": "off", - "unicorn/prefer-top-level-await": "off" - } }, - ] + ], } diff --git a/packages/coreui-react/src/components/accordion/index.ts b/packages/coreui-react/src/components/accordion/index.ts index aef81e77..e1cc95ee 100644 --- a/packages/coreui-react/src/components/accordion/index.ts +++ b/packages/coreui-react/src/components/accordion/index.ts @@ -4,10 +4,4 @@ import { CAccordionButton } from './CAccordionButton' import { CAccordionHeader } from './CAccordionHeader' import { CAccordionItem } from './CAccordionItem' -export { - CAccordion, - CAccordionBody, - CAccordionButton, - CAccordionHeader, - CAccordionItem, -} +export { CAccordion, CAccordionBody, CAccordionButton, CAccordionHeader, CAccordionItem } From 76126f99d2ceb06dbb14dfd04f7ca3d79e174927 Mon Sep 17 00:00:00 2001 From: mrholek Date: Tue, 6 Jun 2023 14:17:21 +0200 Subject: [PATCH 160/476] chore: add comments --- packages/coreui-react/src/components/progress/CProgress.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/coreui-react/src/components/progress/CProgress.tsx b/packages/coreui-react/src/components/progress/CProgress.tsx index 2be506cc..9e49ad8f 100644 --- a/packages/coreui-react/src/components/progress/CProgress.tsx +++ b/packages/coreui-react/src/components/progress/CProgress.tsx @@ -29,6 +29,7 @@ export interface CProgressProps white?: boolean } +// TODO: update markup and add '.progress-stacked' in v5 export const CProgress = forwardRef( ({ children, className, height, thin, value = 0, white, ...rest }, ref) => { return ( From eaab23654a7d910c25d93c9171162b1fbf0cc532 Mon Sep 17 00:00:00 2001 From: mrholek Date: Wed, 7 Jun 2023 00:18:01 +0200 Subject: [PATCH 161/476] docs: update SCSS docs --- .../docs/content/components/accordion.mdx | 59 +---- packages/docs/content/components/alert.mdx | 24 +-- packages/docs/content/components/badge.mdx | 22 +- .../docs/content/components/breadcrumb.mdx | 26 +-- packages/docs/content/components/button.mdx | 87 +------- packages/docs/content/components/callout.mdx | 34 +-- packages/docs/content/components/card.mdx | 40 +--- packages/docs/content/components/carousel.mdx | 34 +-- packages/docs/content/components/dropdown.mdx | 87 +------- packages/docs/content/components/footer.mdx | 20 +- packages/docs/content/components/header.mdx | 69 +----- .../docs/content/components/list-group.mdx | 59 +---- packages/docs/content/components/modal.mdx | 73 +------ packages/docs/content/components/navbar.mdx | 87 ++------ .../docs/content/components/navs-tabs.mdx | 55 +---- .../docs/content/components/offcanvas.mdx | 28 +-- .../docs/content/components/pagination.mdx | 63 +----- .../docs/content/components/placeholder.mdx | 6 + packages/docs/content/components/popover.mdx | 133 +++++++----- packages/docs/content/components/progress.mdx | 26 +-- packages/docs/content/components/sidebar.mdx | 203 +----------------- packages/docs/content/components/spinner.mdx | 35 +-- packages/docs/content/components/toast.mdx | 35 +-- packages/docs/content/components/tooltip.mdx | 72 ++++--- packages/docs/gatsby-config.js | 7 + packages/docs/gatsby-node.js | 43 ++-- packages/docs/src/components/ScssDocs.tsx | 69 ++++-- packages/docs/src/templates/MdxLayout.tsx | 3 +- 28 files changed, 292 insertions(+), 1207 deletions(-) diff --git a/packages/docs/content/components/accordion.mdx b/packages/docs/content/components/accordion.mdx index 951d9523..3dd6c723 100644 --- a/packages/docs/content/components/accordion.mdx +++ b/packages/docs/content/components/accordion.mdx @@ -150,30 +150,7 @@ Add `alwaysOpen` property to make react accordion items stay open when another i React accordions use local CSS variables on `.accordion` for enhanced real-time customization. Values for the CSS variables are set via Sass, so Sass customization is still supported, too. -```sass ---cui-accordion-color: #{color-contrast($accordion-bg)}; ---cui-accordion-bg: #{$accordion-bg}; ---cui-accordion-transition: #{$accordion-transition}; ---cui-accordion-border-color: #{$accordion-border-color}; ---cui-accordion-border-width: #{$accordion-border-width}; ---cui-accordion-border-radius: #{$accordion-border-radius}; ---cui-accordion-inner-border-radius: #{$accordion-inner-border-radius}; ---cui-accordion-btn-padding-x: #{$accordion-button-padding-x}; ---cui-accordion-btn-padding-y: #{$accordion-button-padding-y}; ---cui-accordion-btn-color: #{$accordion-color}; ---cui-accordion-btn-bg: #{$accordion-button-bg}; ---cui-accordion-btn-icon: #{escape-svg($accordion-button-icon)}; ---cui-accordion-btn-icon-width: #{$accordion-icon-width}; ---cui-accordion-btn-icon-transform: #{$accordion-icon-transform}; ---cui-accordion-btn-icon-transition: #{$accordion-icon-transition}; ---cui-accordion-btn-active-icon: #{escape-svg($accordion-button-active-icon)}; ---cui-accordion-btn-focus-border-color: #{$accordion-button-focus-border-color}; ---cui-accordion-btn-focus-box-shadow: #{$accordion-button-focus-box-shadow}; ---cui-accordion-body-padding-x: #{$accordion-body-padding-x}; ---cui-accordion-body-padding-y: #{$accordion-body-padding-y}; ---cui-accordion-active-color: #{$accordion-button-active-color}; ---cui-accordion-active-bg: #{$accordion-button-active-bg}; -``` + #### How to use CSS variables @@ -187,39 +164,7 @@ return ... ### SASS variables -```sass -$accordion-padding-y: 1rem; -$accordion-padding-x: 1.25rem; -$accordion-color: var(--cui-body-color); -$accordion-bg: $body-bg; -$accordion-border-width: $border-width; -$accordion-border-color: var(--cui-border-color); -$accordion-border-radius: $border-radius; -$accordion-inner-border-radius: subtract($accordion-border-radius, $accordion-border-width); - -$accordion-body-padding-y: $accordion-padding-y; -$accordion-body-padding-x: $accordion-padding-x; - -$accordion-button-padding-y: $accordion-padding-y; -$accordion-button-padding-x: $accordion-padding-x; -$accordion-button-color: $accordion-color; -$accordion-button-bg: var(--cui-accordion-bg); -$accordion-transition: $btn-transition, border-radius .15s ease; -$accordion-button-active-bg: tint-color($component-active-bg, 90%); -$accordion-button-active-color: shade-color($primary, 10%); - -$accordion-button-focus-border-color: $input-focus-border-color; -$accordion-button-focus-box-shadow: $btn-focus-box-shadow; - -$accordion-icon-width: 1.25rem; -$accordion-icon-color: $accordion-button-color; -$accordion-icon-active-color: $accordion-button-active-color; -$accordion-icon-transition: transform .2s ease-in-out; -$accordion-icon-transform: rotate(-180deg); - -$accordion-button-icon: url("data:image/svg+xml,"); -$accordion-button-active-icon: url("data:image/svg+xml,"); -``` + ## API diff --git a/packages/docs/content/components/alert.mdx b/packages/docs/content/components/alert.mdx index 68971f76..dee0b432 100644 --- a/packages/docs/content/components/alert.mdx +++ b/packages/docs/content/components/alert.mdx @@ -231,16 +231,7 @@ React Alert component can also be easily dismissed. Just add the `dismissible` p React alerts use local CSS variables on `.alert` for enhanced real-time customization. Values for the CSS variables are set via Sass, so Sass customization is still supported, too. -```sass ---cui-alert-bg: transparent; ---cui-alert-padding-x: #{$alert-padding-x}; ---cui-alert-padding-y: #{$alert-padding-y}; ---cui-alert-margin-bottom: #{$alert-margin-bottom}; ---cui-alert-color: inherit; ---cui-alert-border-color: transparent; ---cui-alert-border: #{$alert-border-width} solid var(--cui-alert-border-color); ---cui-alert-border-radius: #{$alert-border-radius}; -``` + #### How to use CSS variables @@ -254,18 +245,7 @@ return ... ### SASS variables -```sass -$alert-padding-y: $spacer; -$alert-padding-x: $spacer; -$alert-margin-bottom: 1rem; -$alert-border-radius: $border-radius; -$alert-link-font-weight: $font-weight-bold; -$alert-border-width: $border-width; -$alert-bg-scale: -80%; -$alert-border-scale: -70%; -$alert-color-scale: 40%; -$alert-dismissible-padding-r: $alert-padding-x * 3; // 3x covers width of x plus default padding on either side -``` + ## API diff --git a/packages/docs/content/components/badge.mdx b/packages/docs/content/components/badge.mdx index 894a7959..e7efa268 100644 --- a/packages/docs/content/components/badge.mdx +++ b/packages/docs/content/components/badge.mdx @@ -123,14 +123,7 @@ Apply the `shape="rounded-pill"` prop to make badges rounded. React badges use local CSS variables on `.badges` for enhanced real-time customization. Values for the CSS variables are set via Sass, so Sass customization is still supported, too. -```sass ---cui-badge-padding-x: #{$badge-padding-x}; ---cui-badge-padding-y: #{$badge-padding-y}; ---cui-badge-font-size: #{$badge-font-size}; ---cui-badge-font-weight: #{$badge-font-weight}; ---cui-badge-color: #{$badge-color}; ---cui-badge-border-radius: #{$badge-border-radius}; -``` + #### How to use CSS variables @@ -144,18 +137,7 @@ return ... ### SASS variables -```sass -$badge-font-size: .75em; -$badge-font-weight: $font-weight-bold; -$badge-color: $high-emphasis-inverse; -$badge-padding-y: .35em; -$badge-padding-x: .65em; -$badge-border-radius: $border-radius; - -$badge-font-size-sm: .65em; -$badge-padding-y-sm: .3em; -$badge-padding-x-sm: .5em; -``` + ## API diff --git a/packages/docs/content/components/breadcrumb.mdx b/packages/docs/content/components/breadcrumb.mdx index 6c27a8a6..96c0d6df 100644 --- a/packages/docs/content/components/breadcrumb.mdx +++ b/packages/docs/content/components/breadcrumb.mdx @@ -86,17 +86,7 @@ For more information, see the [WAI-ARIA Authoring Practices for the breadcrumb p React breadcrumbs use local CSS variables on `.breadcrumb` for enhanced real-time customization. Values for the CSS variables are set via Sass, so Sass customization is still supported, too. -```sass ---cui-breadcrumb-padding-x: #{$breadcrumb-padding-x}; ---cui-breadcrumb-padding-y: #{$breadcrumb-padding-y}; ---cui-breadcrumb-margin-bottom: #{$breadcrumb-margin-bottom}; ---cui-breadcrumb-font-size: #{$breadcrumb-font-size}; ---cui-breadcrumb-bg: #{$breadcrumb-bg}; ---cui-breadcrumb-border-radius: #{$breadcrumb-border-radius}; ---cui-breadcrumb-divider-color: #{$breadcrumb-divider-color}; ---cui-breadcrumb-item-padding-x: #{$breadcrumb-item-padding-x}; ---cui-breadcrumb-item-active-color: #{$breadcrumb-active-color}; -``` + #### How to use CSS variables @@ -110,19 +100,7 @@ return ... ### SASS variables -```sass -$breadcrumb-font-size: null; -$breadcrumb-padding-y: 0; -$breadcrumb-padding-x: 0; -$breadcrumb-item-padding-x: .5rem; -$breadcrumb-margin-bottom: 1rem; -$breadcrumb-bg: unset; -$breadcrumb-divider-color: $gray-600; -$breadcrumb-active-color: $gray-600; -$breadcrumb-divider: quote("/"); -$breadcrumb-divider-flipped: $breadcrumb-divider; -$breadcrumb-border-radius: null; -``` + ## API diff --git a/packages/docs/content/components/button.mdx b/packages/docs/content/components/button.mdx index 75ef6ecb..4543fb55 100644 --- a/packages/docs/content/components/button.mdx +++ b/packages/docs/content/components/button.mdx @@ -193,22 +193,7 @@ Additional utilities can be used to adjust the alignment of buttons when horizon React buttons use local CSS variables on `.btn` for enhanced real-time customization. Values for the CSS variables are set via Sass, so Sass customization is still supported, too. -```sass ---cui-btn-padding-x: #{$btn-padding-x}; ---cui-btn-padding-y: #{$btn-padding-y}; ---cui-btn-font-family: #{$btn-font-family}; ---cui-btn-font-size: #{$btn-font-size}; ---cui-btn-font-weight: #{$btn-font-weight}; ---cui-btn-line-height: #{$btn-line-height}; ---cui-btn-color: #{$body-color}; ---cui-btn-bg: transparent; ---cui-btn-border-width: #{$btn-border-width}; ---cui-btn-border-color: transparent; ---cui-btn-border-radius: #{$btn-border-radius}; ---cui-btn-box-shadow: #{$btn-box-shadow}; ---cui-btn-disabled-opacity: #{$btn-disabled-opacity}; ---cui-btn-focus-box-shadow: 0 0 0 #{$btn-focus-width} rgba(var(--cui-btn-focus-shadow-rgb), .5); -``` + #### How to use CSS variables @@ -222,75 +207,7 @@ return ... ### SASS variables -```sass -$btn-padding-y: $input-btn-padding-y; -$btn-padding-x: $input-btn-padding-x; -$btn-font-family: $input-btn-font-family; -$btn-font-size: $input-btn-font-size; -$btn-line-height: $input-btn-line-height; -$btn-white-space: null; // Set to `nowrap` to prevent text wrapping - -$btn-padding-y-sm: $input-btn-padding-y-sm; -$btn-padding-x-sm: $input-btn-padding-x-sm; -$btn-font-size-sm: $input-btn-font-size-sm; - -$btn-padding-y-lg: $input-btn-padding-y-lg; -$btn-padding-x-lg: $input-btn-padding-x-lg; -$btn-font-size-lg: $input-btn-font-size-lg; - -$btn-border-width: $input-btn-border-width; - -$btn-font-weight: $font-weight-normal; -$btn-box-shadow: inset 0 1px 0 rgba($white, .15), 0 1px 1px rgba($black, .075); -$btn-focus-width: $input-btn-focus-width; -$btn-focus-box-shadow: $input-btn-focus-box-shadow; -$btn-disabled-opacity: .65; -$btn-active-box-shadow: inset 0 3px 5px rgba($black, .125); - -$btn-link-color: var(--cui-link-color); -$btn-link-hover-color: var(--cui-link-hover-color); -$btn-link-disabled-color: $gray-600; - -// Allows for customizing button radius independently from global border radius -$btn-border-radius: $border-radius; -$btn-border-radius-sm: $border-radius-sm; -$btn-border-radius-lg: $border-radius-lg; - -$btn-transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out; - -$btn-hover-bg-shade-amount: 15%; -$btn-hover-bg-tint-amount: 15%; -$btn-hover-border-shade-amount: 20%; -$btn-hover-border-tint-amount: 10%; -$btn-active-bg-shade-amount: 20%; -$btn-active-bg-tint-amount: 20%; -$btn-active-border-shade-amount: 25%; -$btn-active-border-tint-amount: 10%; - -// scss-docs-start button-variants -$button-variants: ( - "primary": btn-color-map($primary, $primary), - "secondary": btn-color-map($secondary, $secondary), - "success": btn-color-map($success, $success), - "danger": btn-color-map($danger, $danger), - "warning": btn-color-map($warning, $warning), - "info": btn-color-map($info, $info), - "light": btn-color-map($light, $light), - "dark": btn-color-map($dark, $dark) -); - -$button-outline-ghost-variants: ( - "primary": btn-outline-color-map($primary), - "secondary": btn-outline-color-map($secondary), - "success": btn-outline-color-map($success), - "danger": btn-outline-color-map($danger), - "warning": btn-outline-color-map($warning), - "info": btn-outline-color-map($info), - "light": btn-outline-color-map($light), - "dark": btn-outline-color-map($dark) -); -// scss-docs-end button-variants -``` + ## API diff --git a/packages/docs/content/components/callout.mdx b/packages/docs/content/components/callout.mdx index f40b8428..71ef0099 100644 --- a/packages/docs/content/components/callout.mdx +++ b/packages/docs/content/components/callout.mdx @@ -61,16 +61,7 @@ Callout component is prepared for any length of text, as well as an optional ele React callouts use local CSS variables on `.callout` for enhanced real-time customization. Values for the CSS variables are set via Sass, so Sass customization is still supported, too. -```sass ---cui-callout-padding-x: #{$callout-padding-x}; ---cui-callout-padding-y: #{$callout-padding-y}; ---cui-callout-margin-x: #{$callout-margin-x}; ---cui-callout-margin-y: #{$callout-margin-y}; ---cui-callout-border-width: #{$callout-border-width}; ---cui-callout-border-color: #{$callout-border-color}; ---cui-callout-border-left-width: #{$callout-border-left-width}; ---cui-callout-border-radius: #{$callout-border-radius}; -``` + #### How to use CSS variables @@ -84,28 +75,7 @@ return ... ### SASS variables -```sass -$callout-padding-y: $spacer; -$callout-padding-x: $spacer; -$callout-margin-y: $spacer; -$callout-margin-x: 0; -$callout-border-radius: $border-radius; -$callout-border-width: $border-width; -$callout-border-color: $border-color; -$callout-border-left-width: (4 * $callout-border-width); - -$callout-variants: ( - "primary": $primary, - "secondary": $secondary, - "success": $success, - "danger": $danger, - "warning": $warning, - "info": $info, - "light": $light, - "dark": $dark -); -``` - + ## API diff --git a/packages/docs/content/components/card.mdx b/packages/docs/content/components/card.mdx index 59c55761..fc44c610 100644 --- a/packages/docs/content/components/card.mdx +++ b/packages/docs/content/components/card.mdx @@ -972,25 +972,7 @@ Just like with card groups, card footers will automatically line up. React cards use local CSS variables on `.card` for enhanced real-time customization. Values for the CSS variables are set via Sass, so Sass customization is still supported, too. -```sass ---cui-card-spacer-y: #{$card-spacer-y}; ---cui-card-spacer-x: #{$card-spacer-x}; ---cui-card-title-spacer-y: #{$card-title-spacer-y}; ---cui-card-border-width: #{$card-border-width}; ---cui-card-border-color: #{$card-border-color}; ---cui-card-border-radius: #{$card-border-radius}; ---cui-card-box-shadow: #{$card-box-shadow}; ---cui-card-inner-border-radius: #{$card-inner-border-radius}; ---cui-card-cap-padding-y: #{$card-cap-padding-y}; ---cui-card-cap-padding-x: #{$card-cap-padding-x}; ---cui-card-cap-bg: #{$card-cap-bg}; ---cui-card-cap-color: #{$card-cap-color}; ---cui-card-height: #{$card-height}; ---cui-card-color: #{$card-color}; ---cui-card-bg: #{$card-bg}; ---cui-card-img-overlay-padding: #{$card-img-overlay-padding}; ---cui-card-group-margin: #{$card-group-margin}; -``` + #### How to use CSS variables @@ -1004,25 +986,7 @@ return ... ### SASS variables -```sass -$card-spacer-y: $spacer; -$card-spacer-x: $spacer; -$card-title-spacer-y: $spacer * .5; -$card-border-width: $border-width; -$card-border-color: var(--cui-border-color-translucent); -$card-border-radius: $border-radius; -$card-box-shadow: null; -$card-inner-border-radius: subtract($card-border-radius, $card-border-width); -$card-cap-padding-y: $card-spacer-y * .5; -$card-cap-padding-x: $card-spacer-x; -$card-cap-bg: rgba($black, .03); -$card-cap-color: unset; -$card-height: null; -$card-color: unset; -$card-bg: $white; -$card-img-overlay-padding: $spacer; -$card-group-margin: $grid-gutter-width * .5; -``` + ## API diff --git a/packages/docs/content/components/carousel.mdx b/packages/docs/content/components/carousel.mdx index 8d90f360..a79a0ed2 100644 --- a/packages/docs/content/components/carousel.mdx +++ b/packages/docs/content/components/carousel.mdx @@ -215,39 +215,7 @@ Add `dark` property to the `CCarousel` for darker controls, indicators, and capt ### SASS variables -```sass -$carousel-control-color: $high-emphasis-inverse; -$carousel-control-width: 15%; -$carousel-control-opacity: .5; -$carousel-control-hover-opacity: .9; -$carousel-control-transition: opacity .15s ease; - -$carousel-indicator-width: 30px; -$carousel-indicator-height: 3px; -$carousel-indicator-hit-area-height: 10px; -$carousel-indicator-spacer: 3px; -$carousel-indicator-opacity: .5; -$carousel-indicator-active-bg: $white; -$carousel-indicator-active-opacity: 1; -$carousel-indicator-transition: opacity .6s ease; - -$carousel-caption-width: 70%; -$carousel-caption-color: $high-emphasis-inverse; -$carousel-caption-padding-y: 1.25rem; -$carousel-caption-spacer: 1.25rem; - -$carousel-control-icon-width: 2rem; - -$carousel-control-prev-icon-bg: url("data:image/svg+xml,"); -$carousel-control-next-icon-bg: url("data:image/svg+xml,"); - -$carousel-transition-duration: .6s; -$carousel-transition: transform $carousel-transition-duration ease-in-out; // Define transform transition first if using multiple transitions (e.g., `transform 2s ease, opacity .5s ease-out`) - -$carousel-dark-indicator-active-bg: $black; -$carousel-dark-caption-color: $high-emphasis; -$carousel-dark-control-icon-filter: invert(1) grayscale(100); -``` + ## API diff --git a/packages/docs/content/components/dropdown.mdx b/packages/docs/content/components/dropdown.mdx index 5e7a3c57..88299603 100644 --- a/packages/docs/content/components/dropdown.mdx +++ b/packages/docs/content/components/dropdown.mdx @@ -578,50 +578,11 @@ Put a form within a dropdown menu, or make it into a dropdown menu. React dropdowns use local CSS variables on `.dropdown` for enhanced real-time customization. Values for the CSS variables are set via Sass, so Sass customization is still supported, too. -```sass ---cui-dropdown-min-width: #{$dropdown-min-width}; ---cui-dropdown-padding-x: #{$dropdown-padding-x}; ---cui-dropdown-padding-y: #{$dropdown-padding-y}; ---cui-dropdown-spacer: #{$dropdown-spacer}; ---cui-dropdown-font-size: #{$dropdown-font-size}; ---cui-dropdown-color: #{$dropdown-color}; ---cui-dropdown-bg: #{$dropdown-bg}; ---cui-dropdown-border-color: #{$dropdown-border-color}; ---cui-dropdown-border-radius: #{$dropdown-border-radius}; ---cui-dropdown-border-width: #{$dropdown-border-width}; ---cui-dropdown-inner-border-radius: #{$dropdown-inner-border-radius}; ---cui-dropdown-divider-bg: #{$dropdown-divider-bg}; ---cui-dropdown-divider-margin-y: #{$dropdown-divider-margin-y}; ---cui-dropdown-box-shadow: #{$dropdown-box-shadow}; ---cui-dropdown-link-color: #{$dropdown-link-color}; ---cui-dropdown-link-hover-color: #{$dropdown-link-hover-color}; ---cui-dropdown-link-hover-bg: #{$dropdown-link-hover-bg}; ---cui-dropdown-link-active-color: #{$dropdown-link-active-color}; ---cui-dropdown-link-active-bg: #{$dropdown-link-active-bg}; ---cui-dropdown-link-disabled-color: #{$dropdown-link-disabled-color}; ---cui-dropdown-item-padding-x: #{$dropdown-item-padding-x}; ---cui-dropdown-item-padding-y: #{$dropdown-item-padding-y}; ---cui-dropdown-header-color: #{$dropdown-header-color}; ---cui-dropdown-header-padding-x: #{$dropdown-header-padding-x}; ---cui-dropdown-header-padding-y: #{$dropdown-header-padding-y}; -``` + Customization through CSS variables can be seen on the `.dropdown-menu-dark` class where we override specific values without adding duplicate CSS selectors. -```sass ---cui-dropdown-color: #{$dropdown-dark-color}; ---cui-dropdown-bg: #{$dropdown-dark-bg}; ---cui-dropdown-border-color: #{$dropdown-dark-border-color}; ---cui-dropdown-box-shadow: #{$dropdown-dark-box-shadow}; ---cui-dropdown-link-color: #{$dropdown-dark-link-color}; ---cui-dropdown-link-hover-color: #{$dropdown-dark-link-hover-color}; ---cui-dropdown-divider-bg: #{$dropdown-dark-divider-bg}; ---cui-dropdown-link-hover-bg: #{$dropdown-dark-link-hover-bg}; ---cui-dropdown-link-active-color: #{$dropdown-dark-link-active-color}; ---cui-dropdown-link-active-bg: #{$dropdown-dark-link-active-bg}; ---cui-dropdown-link-disabled-color: #{$dropdown-dark-link-disabled-color}; ---cui-dropdown-header-color: #{$dropdown-dark-header-color}; -``` + #### How to use CSS variables @@ -635,41 +596,15 @@ return ... ### SASS variables -```sass -$dropdown-min-width: 10rem; -$dropdown-padding-x: 0; -$dropdown-padding-y: .5rem; -$dropdown-spacer: .125rem; -$dropdown-font-size: $font-size-base; -$dropdown-color: $body-color; -$dropdown-bg: $white; -$dropdown-border-color: var(--cui-border-color-translucent); -$dropdown-border-radius: $border-radius; -$dropdown-border-width: $border-width; -$dropdown-inner-border-radius: subtract($dropdown-border-radius, $dropdown-border-width); -$dropdown-divider-bg: $dropdown-border-color; -$dropdown-divider-margin-y: $spacer * .5; -$dropdown-box-shadow: $box-shadow; - -$dropdown-link-color: $gray-900; -$dropdown-link-hover-color: shade-color($dropdown-link-color, 10%); -$dropdown-link-hover-bg: $gray-200; - -$dropdown-link-active-color: $component-active-color; -$dropdown-link-active-bg: $component-active-bg; - -$dropdown-link-disabled-color: $gray-500; - -$dropdown-item-padding-y: $spacer * .25; -$dropdown-item-padding-x: $spacer; - -$dropdown-header-color: $gray-600; -$dropdown-header-padding-x: $dropdown-item-padding-x; -$dropdown-header-padding-y: $dropdown-padding-y; -// fusv-disable -$dropdown-header-padding: $dropdown-header-padding-y $dropdown-header-padding-x; // Deprecated in v4.2.0 -// fusv-enable -``` + + +Variables for the dark dropdown: + + + +Variables for the CSS-based carets that indicate a dropdown's interactivity: + + ## API diff --git a/packages/docs/content/components/footer.mdx b/packages/docs/content/components/footer.mdx index 01a25590..a1b380c8 100644 --- a/packages/docs/content/components/footer.mdx +++ b/packages/docs/content/components/footer.mdx @@ -30,15 +30,7 @@ import { CFooter, CLink } from '@coreui/react/src/index' React footers use local CSS variables on `.footer` for enhanced real-time customization. Values for the CSS variables are set via Sass, so Sass customization is still supported, too. -```sass ---cui-footer-min-height: #{$footer-min-height}; ---cui-footer-padding-x: #{$footer-padding-x}; ---cui-footer-padding-y: #{$footer-padding-y}; ---cui-footer-color: #{$footer-color}; ---cui-footer-bg: #{$footer-bg}; ---cui-footer-border-color: #{$footer-border-color}; ---cui-footer-border: #{$footer-border-width} solid var(--cui-footer-border-color); -``` + #### How to use CSS variables @@ -52,15 +44,7 @@ return ... ### SASS variables -```sass -$footer-min-height: 3rem; -$footer-padding-y: $spacer * .5; -$footer-padding-x: $spacer; -$footer-bg: $gray-100; -$footer-color: $body-color; -$footer-border-width: 1px; -$footer-border-color: $border-color; -``` + ## API diff --git a/packages/docs/content/components/header.mdx b/packages/docs/content/components/header.mdx index dc97f09b..d19e7c7b 100644 --- a/packages/docs/content/components/header.mdx +++ b/packages/docs/content/components/header.mdx @@ -150,34 +150,7 @@ return ( React headers use local CSS variables on `.header` for enhanced real-time customization. Values for the CSS variables are set via Sass, so Sass customization is still supported, too. -```sass ---cui-header-min-height: #{$header-min-height}; ---cui-header-padding-x: #{$header-padding-x}; ---cui-header-padding-y: #{$header-padding-y}; ---cui-header-bg: #{$header-bg}; ---cui-header-color: #{$header-color}; ---cui-header-border-color: #{$header-border-color}; ---cui-header-border: #{$header-border-width} solid var(--cui-header-border-color); ---cui-header-hover-color: #{$header-hover-color}; ---cui-header-disabled-color: #{$header-disabled-color}; ---cui-header-active-color: #{$header-active-color}; ---cui-header-brand-padding-y: #{$header-brand-padding-y}; ---cui-header-brand-color: #{$header-brand-color}; ---cui-header-brand-hover-color: #{$header-brand-hover-color}; ---cui-header-toggler-padding-x: #{$header-toggler-padding-x}; ---cui-header-toggler-padding-y: #{$header-toggler-padding-y}; ---cui-header-toggler-bg: #{$header-toggler-bg}; ---cui-header-toggler-color: #{$header-toggler-color}; ---cui-header-toggler-border-radius: #{$header-toggler-border-radius}; ---cui-header-toggler-hover-color: #{$header-toggler-hover-color}; ---cui-header-toggler-icon-bg: #{escape-svg($header-toggler-icon-bg)}; ---cui-header-toggler-hover-icon-bg: #{escape-svg($header-toggler-hover-icon-bg)}; ---cui-header-nav-link-padding-x: #{$header-nav-link-padding-x}; ---cui-header-nav-link-padding-y: #{$header-nav-link-padding-y}; ---cui-header-divider-border-color: #{$header-divider-border-color}; ---cui-header-divider-border: #{$header-divider-border-width} solid var(--cui-header-divider-border-color); ---cui-subheader-min-height: #{$subheader-min-height}; -``` + #### How to use CSS variables @@ -191,45 +164,7 @@ return ... ### SASS variables -```sass -$header-min-height: 4rem; -$header-padding-y: $spacer * .5; -$header-padding-x: $spacer * .5; -$header-brand-font-size: $font-size-lg; -$header-color: $medium-emphasis; -$header-bg: $white; -$header-border-color: $border-color; -$header-border-width: 1px; -$header-hover-color: $high-emphasis; -$header-active-color: $high-emphasis; -$header-disabled-color: $disabled; - -// Compute the header-brand padding-y so the header-brand will have the same height as header-text and nav-link -$nav-link-height: $font-size-base * $line-height-base + $nav-link-padding-y * 2; -$header-brand-height: $header-brand-font-size * $line-height-base; -$header-brand-padding-y: ($nav-link-height - $header-brand-height) * .5; -$header-brand-margin-end: 1rem; -$header-brand-font-size: $font-size-lg; -$header-brand-color: $gray-900; -$header-brand-hover-color: shade-color($gray-900, 10%); - -$header-toggler-padding-y: .25rem; -$header-toggler-padding-x: .75rem; -$header-toggler-font-size: $font-size-lg; -$header-toggler-color: $header-color; -$header-toggler-bg: transparent; -$header-toggler-border-radius: $btn-border-radius; -$header-toggler-hover-color: $header-active-color; - -$header-toggler-icon-bg: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='#{$header-color}' stroke-width='2.25' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E"); -$header-toggler-hover-icon-bg: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='#{$header-hover-color}' stroke-width='2.25' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E"); - -$header-nav-link-padding-x: .5rem; -$header-nav-link-padding-y: .5rem; - -$header-divider-border-width: 1px; -$header-divider-border-color: $header-border-color; -``` + ## API diff --git a/packages/docs/content/components/list-group.mdx b/packages/docs/content/components/list-group.mdx index 021966f3..5127f7c0 100644 --- a/packages/docs/content/components/list-group.mdx +++ b/packages/docs/content/components/list-group.mdx @@ -318,25 +318,7 @@ And if you want `