2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-02 03:30:54 +00:00

Bump @tabler/icons-react from 2.47.0 to 3.1.0 in /src/frontend (#6824)

* Bump @tabler/icons-react from 2.47.0 to 3.1.0 in /src/frontend

Bumps [@tabler/icons-react](https://github.com/tabler/tabler-icons/tree/HEAD/packages/icons-react) from 2.47.0 to 3.1.0.
- [Release notes](https://github.com/tabler/tabler-icons/releases)
- [Commits](https://github.com/tabler/tabler-icons/commits/v3.1.0/packages/icons-react)

---
updated-dependencies:
- dependency-name: "@tabler/icons-react"
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update icon props type

TablerIconProps -> IconProps

* add changes proposed by https://github.com/LavissaWoW

* more fixes proposed by @LavissaWoW

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Oliver Walters <oliver.henry.walters@gmail.com>
Co-authored-by: Matthias Mair <code@mjmair.com>
This commit is contained in:
dependabot[bot]
2024-03-25 12:00:30 +11:00
committed by GitHub
parent 4cefbe5171
commit 639851bd58
5 changed files with 32 additions and 24 deletions

View File

@ -77,7 +77,7 @@ import { IconArrowBigDownLineFilled } from '@tabler/icons-react';
import { IconTruckReturn } from '@tabler/icons-react';
import { IconInfoCircle } from '@tabler/icons-react';
import { IconCalendarTime } from '@tabler/icons-react';
import { TablerIconsProps } from '@tabler/icons-react';
import { Icon, IconProps } from '@tabler/icons-react';
import React from 'react';
const icons = {
@ -184,6 +184,9 @@ const icons = {
};
export type InvenTreeIconType = keyof typeof icons;
export type TablerIconType = React.ForwardRefExoticComponent<
Omit<IconProps, 'ref'> & React.RefAttributes<Icon>
>;
/**
* Returns a Tabler Icon for the model field name supplied
@ -193,13 +196,16 @@ export function GetIcon(field: InvenTreeIconType) {
return icons[field];
}
type IconProps = {
// Aliasing the new type name to make it distinct
type TablerIconProps = IconProps;
type InvenTreeIconProps = {
icon: InvenTreeIconType;
iconProps?: TablerIconsProps;
iconProps?: TablerIconProps;
};
export function InvenTreeIcon(props: IconProps) {
let Icon: (props: TablerIconsProps) => React.JSX.Element;
export function InvenTreeIcon(props: InvenTreeIconProps) {
let Icon: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
if (props.icon in icons) {
Icon = GetIcon(props.icon);
@ -212,6 +218,6 @@ export function InvenTreeIcon(props: IconProps) {
return <Icon {...props.iconProps} />;
}
function IconShapes(props: TablerIconsProps): Element {
function IconShapes(props: TablerIconProps): Element {
throw new Error('Function not implemented.');
}