@indico-data/design-system 3.7.0 → 3.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/icons/Icon.d.ts +1 -1
- package/lib/components/icons/types.d.ts +5 -1
- package/lib/index.d.ts +6 -2
- package/lib/index.esm.js +2 -2
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/package.json +7 -7
- package/src/components/icons/Icon.stories.tsx +7 -0
- package/src/components/icons/Icon.tsx +9 -2
- package/src/components/icons/types.ts +5 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@indico-data/design-system",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.9.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@floating-ui/react-dom": "^2.1.1",
|
|
30
|
-
"@fortawesome/fontawesome-svg-core": "^
|
|
31
|
-
"@fortawesome/free-regular-svg-icons": "^
|
|
32
|
-
"@fortawesome/free-solid-svg-icons": "^
|
|
30
|
+
"@fortawesome/fontawesome-svg-core": "^7.1.0",
|
|
31
|
+
"@fortawesome/free-regular-svg-icons": "^7.1.0",
|
|
32
|
+
"@fortawesome/free-solid-svg-icons": "^7.1.0",
|
|
33
33
|
"@fortawesome/react-fontawesome": "^0.2.0",
|
|
34
34
|
"@hookform/resolvers": "^3.9.0",
|
|
35
35
|
"@indico-data/utils": "^0.0.5",
|
|
@@ -166,9 +166,9 @@
|
|
|
166
166
|
"yarn": "4.0.2"
|
|
167
167
|
},
|
|
168
168
|
"peerDependencies": {
|
|
169
|
-
"@fortawesome/fontawesome-svg-core": "^
|
|
170
|
-
"@fortawesome/free-regular-svg-icons": "^
|
|
171
|
-
"@fortawesome/free-solid-svg-icons": "^
|
|
169
|
+
"@fortawesome/fontawesome-svg-core": "^7.1.0",
|
|
170
|
+
"@fortawesome/free-regular-svg-icons": "^7.1.0",
|
|
171
|
+
"@fortawesome/free-solid-svg-icons": "^7.1.0",
|
|
172
172
|
"@fortawesome/react-fontawesome": "^0.2.2",
|
|
173
173
|
"react": "^18.2.0",
|
|
174
174
|
"react-dom": "^18.2.0",
|
|
@@ -3,7 +3,14 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
|
3
3
|
import { IconName as FAIconName, findIconDefinition } from '@fortawesome/fontawesome-svg-core';
|
|
4
4
|
import { IconProps } from './types';
|
|
5
5
|
|
|
6
|
-
export const Icon = ({
|
|
6
|
+
export const Icon = ({
|
|
7
|
+
name,
|
|
8
|
+
size = 'md',
|
|
9
|
+
className,
|
|
10
|
+
ariaLabel,
|
|
11
|
+
faPrefix = 'fas',
|
|
12
|
+
...props
|
|
13
|
+
}: IconProps) => {
|
|
7
14
|
const label = ariaLabel || `${name} Icon`;
|
|
8
15
|
|
|
9
16
|
const iconClasses = classNames(
|
|
@@ -20,7 +27,7 @@ export const Icon = ({ name, size = 'md', className, ariaLabel, ...props }: Icon
|
|
|
20
27
|
// Otherwise, search for an indicon (registered under Font Awesome with a prefix of 'fak')
|
|
21
28
|
const icon = faIconName
|
|
22
29
|
? findIconDefinition({
|
|
23
|
-
prefix:
|
|
30
|
+
prefix: faPrefix,
|
|
24
31
|
iconName: faIconName as FAIconName,
|
|
25
32
|
})
|
|
26
33
|
: findIconDefinition({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MouseEventHandler, CSSProperties } from 'react';
|
|
2
2
|
import { PermafrostComponent } from '../../types';
|
|
3
|
-
import { IconName as FAIconName } from '@fortawesome/fontawesome-svg-core';
|
|
3
|
+
import { IconName as FAIconName, IconPrefix } from '@fortawesome/fontawesome-svg-core';
|
|
4
4
|
import { indicons } from './indicons';
|
|
5
5
|
|
|
6
6
|
export type IconSizes = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
|
|
@@ -20,4 +20,8 @@ export type IconProps = PermafrostComponent & {
|
|
|
20
20
|
style?: CSSProperties;
|
|
21
21
|
/** Click event handler */
|
|
22
22
|
onClick?: MouseEventHandler<SVGElement>;
|
|
23
|
+
/** The Font Awesome prefix of the icon (defaults to 'fas', the solid icon prefix)
|
|
24
|
+
* Only used for Font Awesome icons, not for Indicons.
|
|
25
|
+
*/
|
|
26
|
+
faPrefix?: IconPrefix;
|
|
23
27
|
};
|