@indico-data/design-system 3.8.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.
@@ -1,2 +1,2 @@
1
1
  import { IconProps } from './types';
2
- export declare const Icon: ({ name, size, className, ariaLabel, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element | null;
2
+ export declare const Icon: ({ name, size, className, ariaLabel, faPrefix, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -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
  export type IconSizes = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
6
6
  export type IndiconName = keyof typeof indicons;
@@ -16,4 +16,8 @@ export type IconProps = PermafrostComponent & {
16
16
  style?: CSSProperties;
17
17
  /** Click event handler */
18
18
  onClick?: MouseEventHandler<SVGElement>;
19
+ /** The Font Awesome prefix of the icon (defaults to 'fas', the solid icon prefix)
20
+ * Only used for Font Awesome icons, not for Indicons.
21
+ */
22
+ faPrefix?: IconPrefix;
19
23
  };
package/lib/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { IconDefinition, IconName as IconName$1 } from '@fortawesome/fontawesome-svg-core';
1
+ import { IconDefinition, IconPrefix, IconName as IconName$1 } from '@fortawesome/fontawesome-svg-core';
2
2
  import { UseFloatingOptions } from '@floating-ui/react-dom';
3
3
  export * from '@floating-ui/react-dom';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
@@ -191,6 +191,10 @@ type IconProps = PermafrostComponent & {
191
191
  style?: CSSProperties;
192
192
  /** Click event handler */
193
193
  onClick?: MouseEventHandler<SVGElement>;
194
+ /** The Font Awesome prefix of the icon (defaults to 'fas', the solid icon prefix)
195
+ * Only used for Font Awesome icons, not for Indicons.
196
+ */
197
+ faPrefix?: IconPrefix;
194
198
  };
195
199
 
196
200
  type SelectOption = {
@@ -327,7 +331,7 @@ interface ButtonProps {
327
331
 
328
332
  declare const Button: React$1.ForwardRefExoticComponent<ButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
329
333
 
330
- declare const Icon: ({ name, size, className, ariaLabel, ...props }: IconProps) => react_jsx_runtime.JSX.Element | null;
334
+ declare const Icon: ({ name, size, className, ariaLabel, faPrefix, ...props }: IconProps) => react_jsx_runtime.JSX.Element | null;
331
335
 
332
336
  declare const Table: <T>(props: TableProps<T>) => react_jsx_runtime.JSX.Element;
333
337
 
package/lib/index.esm.js CHANGED
@@ -5016,7 +5016,7 @@ var classnamesExports = classnames.exports;
5016
5016
  var classNames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
5017
5017
 
5018
5018
  const Icon = (_a) => {
5019
- var { name, size = 'md', className, ariaLabel } = _a, props = __rest(_a, ["name", "size", "className", "ariaLabel"]);
5019
+ var { name, size = 'md', className, ariaLabel, faPrefix = 'fas' } = _a, props = __rest(_a, ["name", "size", "className", "ariaLabel", "faPrefix"]);
5020
5020
  const label = ariaLabel || `${name} Icon`;
5021
5021
  const iconClasses = classNames('icon', {
5022
5022
  [`icon--${size}`]: size,
@@ -5026,7 +5026,7 @@ const Icon = (_a) => {
5026
5026
  // Otherwise, search for an indicon (registered under Font Awesome with a prefix of 'fak')
5027
5027
  const icon = faIconName
5028
5028
  ? findIconDefinition({
5029
- prefix: 'fas',
5029
+ prefix: faPrefix,
5030
5030
  iconName: faIconName,
5031
5031
  })
5032
5032
  : findIconDefinition({