Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Design React Kit - Next version based on Bootstrap Italia 2 #885

Closed
wants to merge 96 commits into from
Closed
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
8666f2a
upgrade bs-italia 2.0.3
sabato-galasso Aug 25, 2022
67f3aa0
migrate to webpack 5, upgrade packages, upgrade to bs5-italia-2.0.3
sabato-galasso Aug 30, 2022
eb5bc71
changed screen reader class "sr-only" in "visually-hidden" for all co…
sabato-galasso Sep 2, 2022
22437fc
upgrade bs-italia 2.0.3
sabato-galasso Aug 25, 2022
9962897
migrate to webpack 5, upgrade packages, upgrade to bs5-italia-2.0.3
sabato-galasso Aug 30, 2022
f28233b
changed screen reader class "sr-only" in "visually-hidden" for all co…
sabato-galasso Sep 2, 2022
9303e44
Merge branch 'next' of https://github.com/italia/design-react-kit int…
sabato-galasso Nov 7, 2022
d837bb8
Rebased next by master and fixed incorrect imports
sabato-galasso Nov 8, 2022
a1cd640
fixed lint errors
sabato-galasso Nov 9, 2022
33f8ad5
added missing title in svg ItGoogle
sabato-galasso Nov 9, 2022
2584d0c
regenerate react svg component and fixed test
sabato-galasso Nov 9, 2022
651a3d6
fix compilation error
alenap93 Jan 3, 2023
a80bbed
Merge branch 'master' into next
sabato-galasso Jan 4, 2023
fcf8e72
Merge branch 'italia:next' into next
alenap93 Jan 6, 2023
a37a5b1
upgrade package
alenap93 Jan 7, 2023
bef8d07
fix test
alenap93 Jan 8, 2023
2c611a4
porting to bs-it 2
alenap93 Jan 8, 2023
9718cb2
fix `no such directory` storybook build
sabato-galasso Jan 9, 2023
f7909f5
chora: add migration guide
alenap93 Jan 9, 2023
6ab6513
Merge branch 'next' into next
alenap93 Jan 9, 2023
a3688a7
Merge branch 'next' of https://github.com/alenap93/design-react-kit i…
alenap93 Jan 9, 2023
515e93e
revert upgrade made with latest commits of fork and add update bootst…
alenap93 Jan 9, 2023
8153018
add bootstrap-italia as dep
alenap93 Jan 9, 2023
58b9c0e
Merge pull request #915 from alenap93/next
sabato-galasso Jan 9, 2023
720a35c
update Storybook to 6.5.15 and resolved deprecations warning DocGen
sabato-galasso Jan 10, 2023
7dbc5d6
resolved deprecations warning react-docgen-typescript
sabato-galasso Jan 10, 2023
df6f796
Merge branch '918-chore-upgrade-to-latest-storybook' of github.com:it…
sabato-galasso Jan 15, 2023
38decdd
resolve unformatted files
sabato-galasso Jan 15, 2023
89c575d
fixed minor deprecation warning in @rollup/plugin-replace
sabato-galasso Jan 23, 2023
4d0b620
revert commit 89c575dd7cb5fd7da9e697dc9f0ebbb314bc4c2a
sabato-galasso Jan 23, 2023
cb484b9
Merge pull request #920 from italia/918-chore-upgrade-to-latest-story…
sabato-galasso Jan 23, 2023
c57252b
changed classes validation input fields
sabato-galasso Feb 7, 2023
cef93fa
feat: accordion component
sabato-galasso Feb 7, 2023
d05a7b4
add documentation for InputOra
astagi Feb 7, 2023
6edcfc7
feat: add custom props for classes in AccordionBody
sabato-galasso Feb 7, 2023
8f8ab7b
fix: add attribute type="button" if html tag is a button
sabato-galasso Feb 8, 2023
fc9b402
fix: logic for added error class
sabato-galasso Feb 8, 2023
6fdcb87
Update stories/Section/Section.stories.mdx
sabato-galasso Feb 13, 2023
f4e0029
added missing module 'babel-plugin-dynamic-import-node/utils'
sabato-galasso Feb 21, 2023
9ec2c51
updated @babel/core to ^7.21.0
sabato-galasso Feb 24, 2023
593774d
Merge pull request #943 from italia/942-bug-error-cannot-find-module-…
sabato-galasso Feb 24, 2023
e5fcfed
added babel-plugin-dynamic-import-node
sabato-galasso Feb 27, 2023
65003d3
Added documentations in MDX format and changed element .steppers-inde…
sabato-galasso Feb 28, 2023
2e72d4b
update documentation and removed duplicate accessibility tag (#941)
sabato-galasso Feb 28, 2023
009e35e
fix: missing className for callout component
sabato-galasso Mar 16, 2023
c5bb392
fix: remove duplicate close button in chips
sabato-galasso Mar 21, 2023
449381c
chore: add action for auto release
astagi Mar 22, 2023
c2cf738
5.0.0-0
astagi Mar 22, 2023
a27a50c
Fix accordion's arrow orientation (#953)
federico-ntr Apr 21, 2023
5ac9910
fix: full responsive right action button in slim header breaking into…
federico-ntr May 5, 2023
a48c6e7
fix: updated Slim header instructions docs (#958)
federico-ntr May 5, 2023
3ff2d00
954 back to top (#960)
federico-ntr May 30, 2023
844f084
Update Alert component (#962)
federico-ntr Jun 1, 2023
8c9d834
Update Callout (#961)
federico-ntr Jun 1, 2023
293815a
docs: add docs for mixed button variant (#966)
federico-ntr Jun 7, 2023
8b4360b
docs: fix click on radios always controlling first story (#965)
federico-ntr Jun 7, 2023
f72d0ed
Update Card component (#964)
federico-ntr Jun 8, 2023
92a4d8a
Update Breadcrumbs to be BI 2.x compliant (#968)
federico-ntr Jun 8, 2023
5a97484
docs: translate and update docs (adapted from BI) (#969)
federico-ntr Jul 10, 2023
1c8e5a7
feat: upgrade bsi
astagi Aug 8, 2023
82571c4
5.0.0-1
astagi Aug 8, 2023
f447e33
chore: add new button statuses
astagi Aug 30, 2023
7f451b8
Add state per la corretta visualizzazione input (#974)
Virtute90 Oct 5, 2023
8edd804
fix: set default value for text prop in input
tensor5 Dec 4, 2023
5124f2c
feat: rework select to use reactstrap implementation
federico-ntr Dec 4, 2023
bf2ba3d
feat: autocomplete component
sabato-galasso Dec 4, 2023
53278bd
chore(deps): upgrade bsi
astagi Dec 4, 2023
622aef9
feat: mixed button
sabato-galasso Dec 4, 2023
13df0dd
docs: update button
sabato-galasso Dec 4, 2023
b3c0540
chore: update contributors
astagi Dec 4, 2023
6c95755
fix: autocomplete style
sabato-galasso Dec 4, 2023
1c8b68b
chore: linting
astagi Dec 4, 2023
4a66ade
5.0.0-2
astagi Dec 4, 2023
97f908c
fix: use div for form validation
astagi Dec 6, 2023
2a5a1f8
feat: separate validation and info texts
astagi Dec 6, 2023
d9a3313
feat: remove time input and use standar inputs
astagi Dec 6, 2023
79bacae
chore(deps): upgrade bootstrap italia
astagi Dec 6, 2023
49c2de0
fix: correct label for date and time inputs
astagi Dec 6, 2023
79d01fc
fix: active label by type
astagi Dec 6, 2023
5555fb7
chore(deps): update yarn lock
astagi Dec 6, 2023
ce1bc42
chore: add format-code command
astagi Dec 6, 2023
227f064
5.0.0-3
astagi Dec 6, 2023
316bc45
chore: remove comuni templates as outdated
astagi Dec 6, 2023
32982a1
feat: remove collapse component
astagi Dec 6, 2023
20499a0
fix: badge examples
astagi Dec 6, 2023
02ded3d
fix: skip links
astagi Dec 6, 2023
593dac7
feat: remove cookiebar (not planned)
astagi Dec 6, 2023
a1536e6
fix: update icons
astagi Dec 6, 2023
70529bd
fix: icons
astagi Dec 6, 2023
33ffa11
5.0.0-4
astagi Dec 6, 2023
eb87e64
fix: restore collapse
astagi Dec 7, 2023
c10f781
feat: add go back component
astagi Dec 7, 2023
8f5c6b6
fix: go back icon margins
astagi Dec 7, 2023
348bb62
5.0.0-5
astagi Dec 7, 2023
2bb0110
fix: export collapse component
astagi Dec 7, 2023
d59741c
5.0.0-6
astagi Dec 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
const CircularDependencyPlugin = require('circular-dependency-plugin')

module.exports = {
core: {
builder: 'webpack5',
},
stories: ['../stories/**/*.stories.@(ts|tsx|js|jsx|mdx)'],
addons: [
'@storybook/addon-postcss',
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-a11y'
],
reactOptions: { legacyRootApi: true },
// https://storybook.js.org/docs/react/configure/typescript#mainjs-configuration
typescript: {
check: true, // type-check stories during Storybook build
Expand Down Expand Up @@ -44,4 +48,8 @@ module.exports = {

return config;
},
staticDirs: [
'../static',
{ from: '../assets', to: '/' },
],
};
2 changes: 1 addition & 1 deletion .storybook/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ import {theme} from './theme';

addons.setConfig({
theme
})
})
4 changes: 2 additions & 2 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const parameters = {

const aFullStoryName = `${aSubSections.join('-')}-${aStory}`
const bFullStoryName = `${bSubSections.join('-')}-${bStory}`
// Sort by Section
// Sort by Section
const groupScore = (order[aSection as MainSection] - order[bSection as MainSection]);


Expand Down Expand Up @@ -78,4 +78,4 @@ export const parameters = {

export const decorators = [
(Story: Function) => <div style={customStyle}><FontLoader /><Story/></div>
]
]
96 changes: 48 additions & 48 deletions assets/css/fonts.css

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions example/footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ export default ({ townName, townTagLine }) => (
size='sm'
className='align-top'
/>
<span className='sr-only'>Designers Italia</span>
<span className='visually-hidden'>Designers Italia</span>
</a>
</li>
<li className='list-inline-item'>
Expand All @@ -221,7 +221,7 @@ export default ({ townName, townTagLine }) => (
size='sm'
className='align-top'
/>
<span className='sr-only'>Twitter</span>
<span className='visually-hidden'>Twitter</span>
</a>
</li>
<li className='list-inline-item'>
Expand All @@ -232,7 +232,7 @@ export default ({ townName, townTagLine }) => (
size='sm'
className='align-top'
/>
<span className='sr-only'>Medium</span>
<span className='visually-hidden'>Medium</span>
</a>
</li>
<li className='list-inline-item'>
Expand All @@ -243,7 +243,7 @@ export default ({ townName, townTagLine }) => (
size='sm'
className='align-top'
/>
<span className='sr-only'>Behance</span>
<span className='visually-hidden'>Behance</span>
</a>
</li>
</ul>
Expand All @@ -254,7 +254,7 @@ export default ({ townName, townTagLine }) => (
</div>
<div className='it-footer-small-prints clearfix'>
<Container>
<h3 className='sr-only'>Sezione Link Utili</h3>
<h3 className='visually-hidden'>Sezione Link Utili</h3>
<ul className='it-footer-small-prints-list list-inline mb-0 d-flex flex-column flex-md-row'>
<li className='list-inline-item'>
<a href='#' title='Note Legali'>
Expand Down
2 changes: 1 addition & 1 deletion example/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export class NavHeader extends React.Component<
<NavItem active={isActive} key={label}>
<NavLink href='#' active={isActive}>
<span>{label}</span>
{isActive && <span className='sr-only'>current</span>}
{isActive && <span className='visually-hidden'>current</span>}
</NavLink>
</NavItem>
);
Expand Down
76 changes: 44 additions & 32 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "design-react-kit",
"description": "Componenti React per Bootstrap 4",
"description": "Componenti React per Bootstrap 5",
"keywords": [
"react",
"bootstrap",
Expand Down Expand Up @@ -39,7 +39,7 @@
"url": "git+https://github.com/italia/design-react-kit.git"
},
"engines": {
"node": ">=10"
"node": ">=14"
},
"scripts": {
"start": "npm run storybook:serve",
Expand All @@ -54,15 +54,15 @@
"size": "size-limit",
"analyze": "size-limit --why",
"prestorybook": "npm run svg:import",
"storybook:serve": "start-storybook -p 9001 -c .storybook -s ./static",
"storybook:serve": "start-storybook -p 9001 -c .storybook",
"storybook:build": "npm run storybook:build:base --docs",
"storybook:build:base": "build-storybook -c .storybook -s ./static",
"storybook:build:base": "build-storybook -c .storybook",
"storybook:deploy": "npx gh-pages -d storybook-static -m 'Update GitHub Pages [ci skip]'",
"chromatic": "npx chromatic"
},
"peerDependencies": {
"bootstrap-italia": "^1.4.3",
"react": ">=16.8.0"
"bootstrap-italia": "^2.0.3",
"react": ">=17.0.2"
},
"browserslist": [
"extends browserslist-config-design-italia"
Expand All @@ -81,61 +81,69 @@
"./{src,stories,test}/**/*.{js,ts,tsx,jsx,mdx}": "yarn lint:staged"
},
"devDependencies": {
"@babel/core": "^7.13.15",
"@babel/core": "^7.20.2",
"@babel/helper-remap-async-to-generator": "^7.18.9",
"@rollup/plugin-url": "^6.0.0",
"@size-limit/preset-small-lib": "^4.10.2",
"@size-limit/preset-small-lib": "^8.0.1",
"@skypack/package-check": "^0.2.2",
"@storybook/addon-a11y": "^6.3.9",
"@storybook/addon-essentials": "^6.3.9",
"@storybook/addon-links": "^6.3.9",
"@storybook/addon-a11y": "^6.5.10",
"@storybook/addon-docs": "^6.5.13",
"@storybook/addon-essentials": "^6.5.10",
"@storybook/addon-links": "^6.5.10",
"@storybook/addon-postcss": "^2.0.0",
"@storybook/addon-storyshots": "^6.3.9",
"@storybook/addons": "^6.3.9",
"@storybook/react": "^6.3.9",
"@storybook/addon-storyshots": "^6.5.10",
"@storybook/addons": "^6.5.10",
"@storybook/builder-webpack5": "^6.5.10",
"@storybook/components": "^6.5.13",
"@storybook/manager-webpack5": "^6.5.10",
"@storybook/react": "^6.5.10",
"@svgr/cli": "^6.4.0",
"@svgr/rollup": "^6.4.0",
"@svgr/webpack": "^6.4.0",
"@testing-library/jest-dom": "^5.12.0",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^11.2.6",
"@types/is-number": "^7.0.1",
"@types/react": "^17.0.3",
"@types/react-dom": "^17.0.3",
"@types/is-number": "^7.0.3",
"@types/react": "^17.0.2",
"@types/react-dom": "^17.0.2",
"@types/react-select": "^4.0.15",
"@types/react-transition-group": "^4.4.1",
"autoprefixer": "^9.8.6",
"babel-loader": "^8.2.2",
"bootstrap-italia": "^1.4.3",
"@types/react-transition-group": "^4.4.5",
"autoprefixer": "^9.8.8",
"babel-jest": "^26.6.3",
"babel-loader": "^8.2.5",
"bootstrap-italia": "^2.0.3",
"browserslist-config-design-italia": "^1.0.0",
"chromatic": "^6.3.4",
"chromatic": "^6.8.0",
"circular-dependency-plugin": "^5.2.2",
"eslint-plugin-mdx": "^1.13.0",
"eslint-plugin-prettier": "^3.4.0",
"husky": "^7.0.4",
"husky": "^8.0.1",
"identity-obj-proxy": "^3.0.0",
"jest": "^26",
"jest-transform-stub": "^2.0.0",
"lint-staged": "^12.1.7",
"lint-staged": "^13.0.3",
"postcss": "^7.0.39",
"postcss-flexbugs-fixes": "^4.2.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-is": "^17.0.2",
"size-limit": "^4.10.2",
"ts-jest": "^26.4.4",
"size-limit": "^8.0.1",
"ts-jest": "^26.5.6",
"tsdx": "^0.14.1",
"tslib": "^2.4.0",
"typeface-lora": "^1.1.13",
"typeface-roboto-mono": "^1.1.13",
"typescript": "^4.2.4"
"typescript": "^4.8.2",
"webpack": "^5.74.0"
},
"dependencies": {
"classnames": "^2.3.1",
"is-number": "^7.0.0",
"react-select": "^4.3.0",
"react-stickup": "^1.12.0",
"react-stickup": "^1.12.1",
"react-toastify": "^7.0.4",
"react-transition-group": "^4.4.1",
"react-transition-group": "^4.4.5",
"react-use-navscroll": "0.2.0",
"reactstrap": "^8.9.0",
"reactstrap": "^9.1.4",
"webfontloader": "^1.6.28"
},
"jest": {
Expand All @@ -157,5 +165,9 @@
"node",
"mdx"
]
},
"resolutions": {
"@types/react": "17.0.2",
"@types/react-dom": "17.0.2"
}
}
}
2 changes: 1 addition & 1 deletion src/Accordion/AccordionHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const AccordionHeader: FC<AccordionHeaderProps> = ({
className={toggleClasses}
onClick={onToggle}
{...attributes}
/>
sabato-galasso marked this conversation as resolved.
Show resolved Hide resolved
></Tag>
{append}
</div>
);
Expand Down
3 changes: 2 additions & 1 deletion src/Alert/Alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import React, {
ElementType,
Ref
} from 'react';
import { Alert as InnerAlert, FadeProps, CSSModule } from 'reactstrap';
import { Alert as InnerAlert, FadeProps } from 'reactstrap';
import { CSSModule } from 'reactstrap/types/lib/utils';

// Copy over from reactstrap and add new ones
export interface AlertProps extends HTMLAttributes<HTMLElement> {
Expand Down
3 changes: 2 additions & 1 deletion src/Badge/Badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import React, {
ReactChild,
AnchorHTMLAttributes
} from 'react';
import { Badge as BadgeReact, CSSModule } from 'reactstrap';
import { Badge as BadgeReact } from 'reactstrap';
import { CSSModule } from 'reactstrap/types/lib/utils';

export type BadgeProps = {
/** Le varianti di colore definite in Bootstrap Italia */
Expand Down
2 changes: 1 addition & 1 deletion src/BottomNav/BottomNavItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const BottomNavItem: FC<BottomNavItemProps> = ({
<Icon icon={iconName} />
<span className='bottom-nav-label'>
{label}
{srText ? <span className='sr-only'>{srText}</span> : null}
{srText ? <span className='visually-hidden'>{srText}</span> : null}
</span>
</Tag>
</li>
Expand Down
3 changes: 2 additions & 1 deletion src/Breadcrumb/Breadcrumb.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { ElementType, FC, HTMLAttributes } from 'react';
import { Breadcrumb as BreadcrumbBase, CSSModule } from 'reactstrap';
import { Breadcrumb as BreadcrumbBase } from 'reactstrap';
import classNames from 'classnames';
import { CSSModule } from 'reactstrap/types/lib/utils';

export interface BreadcrumbProps extends HTMLAttributes<HTMLDivElement> {
/** Utilizzarlo in caso di utilizzo di componenti personalizzati */
Expand Down
2 changes: 1 addition & 1 deletion src/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { FC, ButtonHTMLAttributes, ElementType, Ref } from 'react';
import classNames from 'classnames';

import { Button as ButtonBase } from 'reactstrap';
import type { CSSModule } from 'reactstrap';
import { CSSModule } from 'reactstrap/types/lib/utils';

// reactstrap wrapper
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
Expand Down
3 changes: 2 additions & 1 deletion src/Card/Card.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { FC, HTMLAttributes, ElementType, Ref } from 'react';
import classNames from 'classnames';
import { Card as CardBase, CSSModule } from 'reactstrap';
import { Card as CardBase } from 'reactstrap';
import { CSSModule } from 'reactstrap/types/lib/utils';

export interface CardProps extends HTMLAttributes<HTMLElement> {
/** Utilizzarlo in caso di utilizzo di componenti personalizzati */
Expand Down
4 changes: 2 additions & 2 deletions src/Card/CardBody.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { FC, HTMLAttributes, ElementType, Ref } from 'react';
import { CardBody as InnerCardBody, CSSModule } from 'reactstrap';

import { CardBody as InnerCardBody } from 'reactstrap';
import { CSSModule } from 'reactstrap/types/lib/utils';
// Note: this is a wrapper class around a reactstrap component.
// TODO: remove this class and restore the direct import when
// https://github.com/storybookjs/storybook/issues/10536 gets resolved
Expand Down
4 changes: 2 additions & 2 deletions src/Card/CardText.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { FC, HTMLAttributes, ElementType } from 'react';
import { CardText as InnerCardText, CSSModule } from 'reactstrap';

import { CardText as InnerCardText } from 'reactstrap';
import { CSSModule } from 'reactstrap/types/lib/utils';
// Note: this is a wrapper class around a reactstrap component.
// TODO: remove this class and restore the direct import when
// https://github.com/storybookjs/storybook/issues/10536 gets resolved
Expand Down
5 changes: 3 additions & 2 deletions src/Collapse/Collapse.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React, { ElementType, FC, HTMLAttributes, Ref } from 'react';
import classNames from 'classnames';

import { Collapse as CollapseBase, CSSModule } from 'reactstrap';
import { Collapse as CollapseBase } from 'reactstrap';
import { CSSModule } from 'reactstrap/types/lib/utils';

// Copy over from reactstrap and add new ones
export interface CollapseProps extends HTMLAttributes<HTMLElement> {
Expand Down Expand Up @@ -72,7 +73,7 @@ export const Collapse: FC<CollapseProps> = ({
{...attributes}
>
<div className='overlay' style={style} onClick={onOverlayClick}></div>
<div className='close-div sr-only'>
<div className='close-div visually-hidden'>
<button className='btn close-menu' type='button'>
<span className='it-close'></span>close
</button>
Expand Down
3 changes: 2 additions & 1 deletion src/Header/HeaderBrand.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { AnchorHTMLAttributes, ElementType, ReactChild } from 'react';
import classNames from 'classnames';
import { CSSModule, NavbarBrand } from 'reactstrap';
import { NavbarBrand } from 'reactstrap';
import { CSSModule } from 'reactstrap/types/lib/utils';
import { CENTER, useHeaderContext } from './HeaderContext';
import { Icon } from '../Icon/Icon';

Expand Down
4 changes: 2 additions & 2 deletions src/Icon/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function preloadIcons(icons: IconName[]) {
return Promise.all(icons.map((icon) => loadIcon(icon))).then(
(preloadedIcons) => {
preloadedIcons.forEach(({ component }, i) => {
iconsCache[icons[i]] = ((() => component) as unknown) as FC<
iconsCache[icons[i]] = (() => component) as unknown as FC<
SVGProps<SVGSVGElement>
>;
});
Expand Down Expand Up @@ -100,7 +100,7 @@ export const Icon: FC<IconProps> = ({
useEffect(() => {
if (isBundledIcon(icon) && !iconsCache[icon]) {
loadIcon(icon).then(({ component }) => {
iconsCache[icon] = ((() => component) as unknown) as FC<
iconsCache[icon] = (() => component) as unknown as FC<
SVGProps<SVGSVGElement> & SVGRProps
>;
setCurrentIcon(iconsCache[icon]);
Expand Down
Loading