@fluentui/react-icons-compat 0.2.21 → 0.2.23

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/CHANGELOG.md CHANGED
@@ -1,12 +1,34 @@
1
1
  # Change Log - @fluentui/react-icons-compat
2
2
 
3
- This log was last generated on Wed, 24 Jun 2026 11:03:59 GMT and should not be manually modified.
3
+ <!-- This log was last generated on Mon, 24 Aug 2026 08:15:11 GMT and should not be manually modified. -->
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [0.2.23](https://github.com/microsoft/fluentui/tree/@fluentui/react-icons-compat_v0.2.23)
8
+
9
+ Mon, 24 Aug 2026 08:15:11 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-icons-compat_v0.2.22..@fluentui/react-icons-compat_v0.2.23)
11
+
12
+ ### Patches
13
+
14
+ - fix: align react/react-dom/@types peerDependencies with the react/jsx-runtime 16.14.0 floor ([PR #36551](https://github.com/microsoft/fluentui/pull/36551) by martinhochel@microsoft.com)
15
+
16
+ ## [0.2.22](https://github.com/microsoft/fluentui/tree/@fluentui/react-icons-compat_v0.2.22)
17
+
18
+ Tue, 11 Aug 2026 17:20:14 GMT
19
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-icons-compat_v0.2.21..@fluentui/react-icons-compat_v0.2.22)
20
+
21
+ ### Patches
22
+
23
+ - Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake. ([PR #36327](https://github.com/microsoft/fluentui/pull/36327) by martinhochel@microsoft.com)
24
+ - Bump @fluentui/react-jsx-runtime to v9.4.5 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
25
+ - Bump @fluentui/react-shared-contexts to v9.26.3 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
26
+ - Bump @fluentui/react-theme to v9.2.2 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
27
+ - Bump @fluentui/react-utilities to v9.26.6 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
28
+
7
29
  ## [0.2.21](https://github.com/microsoft/fluentui/tree/@fluentui/react-icons-compat_v0.2.21)
8
30
 
9
- Wed, 24 Jun 2026 11:03:59 GMT
31
+ Wed, 24 Jun 2026 11:10:10 GMT
10
32
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-icons-compat_v0.2.20..@fluentui/react-icons-compat_v0.2.21)
11
33
 
12
34
  ### Patches
@@ -0,0 +1,89 @@
1
+ import type { JSXElement } from '@fluentui/react-utilities';
2
+
3
+ /**
4
+ * Gets an icon definition. If an icon is requested but the subset has yet to be registered,
5
+ * it will get registered immediately.
6
+ *
7
+ * @public
8
+ * @param name - Name of icon.
9
+ */
10
+ export declare function getIcon(name?: string): IconRecord | undefined;
11
+
12
+ export declare interface IconOptions {
13
+ /**
14
+ * By default, registering the same set of icons will generate a console warning per duplicate icon
15
+ * registered, because this scenario can create unexpected consequences.
16
+ *
17
+ * Some scenarios include:
18
+ *
19
+ * Icon set was previously registered using a different base url.
20
+ * Icon set was previously registered but a different version was provided.
21
+ * Icons in a previous registered set overlap with a new set.
22
+ *
23
+ * To simply ignore previously registered icons, you can specify to disable warnings. This means
24
+ * that if an icon which was previous registered is registered again, it will be silently ignored.
25
+ * However, consider whether the problems listed above will cause issues.
26
+ **/
27
+ disableWarnings: boolean;
28
+ /**
29
+ * @deprecated Use `disableWarnings` instead.
30
+ */
31
+ warnOnMissingIcons?: boolean;
32
+ }
33
+
34
+ export declare interface IconRecord {
35
+ code: string | undefined;
36
+ subset: IconSubsetRecord;
37
+ }
38
+
39
+ export declare interface IconRecords {
40
+ __options: IconOptions;
41
+ __remapped: {
42
+ [key: string]: string;
43
+ };
44
+ [key: string]: IconRecord | {};
45
+ }
46
+
47
+ export declare interface IconSubset {
48
+ icons: {
49
+ [key: string]: string | JSXElement;
50
+ };
51
+ /**
52
+ * Indicates to the icon renderer that it is safe to merge any props on the original `Icon` element
53
+ * onto the child content element registered for the icon which are valid for HTML images.
54
+ */
55
+ mergeImageProps?: boolean;
56
+ }
57
+
58
+ export declare interface IconSubsetRecord extends IconSubset {
59
+ isRegistered?: boolean;
60
+ className?: string;
61
+ }
62
+
63
+ /**
64
+ * Remaps one icon name to another.
65
+ */
66
+ export declare function registerIconAlias(iconName: string, mappedToName: string): void;
67
+
68
+ /**
69
+ * Registers a given subset of icons.
70
+ *
71
+ * @param iconSubset - the icon subset definition.
72
+ */
73
+ export declare function registerIcons(iconSubset: IconSubset, options?: Partial<IconOptions>): void;
74
+
75
+ /**
76
+ * Sets the icon options.
77
+ *
78
+ * @public
79
+ */
80
+ export declare function setIconOptions(options: Partial<IconOptions>): void;
81
+
82
+ /**
83
+ * Unregisters icons by name.
84
+ *
85
+ * @param iconNames - List of icons to unregister.
86
+ */
87
+ export declare function unregisterIcons(iconNames: string[]): void;
88
+
89
+ export { }
@@ -1,4 +1,4 @@
1
- import { getWindow } from './getWindow';
1
+ import { getWindow } from "./getWindow.js";
2
2
  /**
3
3
  * Storing global state in local module variables has issues when more than one copy
4
4
  * of the module gets loaded on the page (due to a bundling error or simply by consuming
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/GlobalSettings.ts"],"sourcesContent":["import { getWindow } from './getWindow';\n\n/**\n * Storing global state in local module variables has issues when more than one copy\n * of the module gets loaded on the page (due to a bundling error or simply by consuming\n * a prebundled script.)\n *\n * This file contains helpers to deal with the getting and setting local state, and allows\n * callers to get called back when it mutates.\n */\n\nconst GLOBAL_SETTINGS_PROP_NAME = '__globalSettings__';\nconst CALLBACK_STATE_PROP_NAME = '__callbacks__';\n\nlet _counter = 0;\n\n/**\n * Change description used for change callbacks in GlobalSettings.\n *\n * @public\n */\nexport interface ChangeDescription {\n key: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n oldValue: any;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value: any;\n}\n\n/**\n * Change event callback.\n *\n * @public\n */\nexport interface ChangeEventCallback {\n __id__?: string;\n (changeDescription?: ChangeDescription): void;\n}\n\n/**\n * Global settings helper, which stores settings in the global (window) namespace.\n * If window is not provided, it will store settings in module scope. Provides a\n * way to observe changes as well when their values change.\n *\n * @public\n */\nexport class GlobalSettings {\n public static getValue<T>(key: string, defaultValue?: T | (() => T)): T {\n const globalSettings = _getGlobalSettings();\n\n if (globalSettings[key] === undefined) {\n globalSettings[key] = typeof defaultValue === 'function' ? (defaultValue as Function)() : defaultValue;\n }\n\n return globalSettings[key];\n }\n\n public static setValue<T>(key: string, value: T): T {\n const globalSettings = _getGlobalSettings();\n const callbacks = globalSettings[CALLBACK_STATE_PROP_NAME];\n const oldValue = globalSettings[key];\n\n if (value !== oldValue) {\n globalSettings[key] = value;\n\n const changeDescription = {\n oldValue,\n value,\n key,\n };\n\n for (const id in callbacks) {\n if (callbacks.hasOwnProperty(id)) {\n callbacks[id](changeDescription);\n }\n }\n }\n\n return value;\n }\n\n public static addChangeListener(cb: ChangeEventCallback): void {\n // Note: we use generated ids on the callbacks to create a map of the callbacks, which optimizes removal.\n // (It's faster to delete a key than it is to look up the index of an object and splice an array.)\n let id = cb.__id__;\n const callbacks = _getCallbacks();\n\n if (!id) {\n id = cb.__id__ = String(_counter++);\n }\n\n callbacks[id] = cb;\n }\n\n public static removeChangeListener(cb: ChangeEventCallback): void {\n const callbacks = _getCallbacks();\n delete callbacks[cb.__id__ as string];\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction _getGlobalSettings(): { [key: string]: any } {\n const win = getWindow();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const globalObj: { [key: string]: any } = win || {};\n\n if (!globalObj[GLOBAL_SETTINGS_PROP_NAME]) {\n globalObj[GLOBAL_SETTINGS_PROP_NAME] = {\n [CALLBACK_STATE_PROP_NAME]: {},\n };\n }\n\n return globalObj[GLOBAL_SETTINGS_PROP_NAME];\n}\n\nfunction _getCallbacks(): { [key: string]: () => void } {\n const globalSettings = _getGlobalSettings();\n return globalSettings[CALLBACK_STATE_PROP_NAME];\n}\n"],"names":["getWindow","GLOBAL_SETTINGS_PROP_NAME","CALLBACK_STATE_PROP_NAME","_counter","GlobalSettings","getValue","key","defaultValue","globalSettings","_getGlobalSettings","undefined","setValue","value","callbacks","oldValue","changeDescription","id","hasOwnProperty","addChangeListener","cb","__id__","_getCallbacks","String","removeChangeListener","win","globalObj"],"mappings":"AAAA,SAASA,SAAS,QAAQ,cAAc;AAExC;;;;;;;CAOC,GAED,MAAMC,4BAA4B;AAClC,MAAMC,2BAA2B;AAEjC,IAAIC,WAAW;AAyBf;;;;;;CAMC,GACD,OAAO,MAAMC;IACX,OAAcC,SAAYC,GAAW,EAAEC,YAA4B,EAAK;QACtE,MAAMC,iBAAiBC;QAEvB,IAAID,cAAc,CAACF,IAAI,KAAKI,WAAW;YACrCF,cAAc,CAACF,IAAI,GAAG,OAAOC,iBAAiB,aAAa,AAACA,iBAA8BA;QAC5F;QAEA,OAAOC,cAAc,CAACF,IAAI;IAC5B;IAEA,OAAcK,SAAYL,GAAW,EAAEM,KAAQ,EAAK;QAClD,MAAMJ,iBAAiBC;QACvB,MAAMI,YAAYL,cAAc,CAACN,yBAAyB;QAC1D,MAAMY,WAAWN,cAAc,CAACF,IAAI;QAEpC,IAAIM,UAAUE,UAAU;YACtBN,cAAc,CAACF,IAAI,GAAGM;YAEtB,MAAMG,oBAAoB;gBACxBD;gBACAF;gBACAN;YACF;YAEA,IAAK,MAAMU,MAAMH,UAAW;gBAC1B,IAAIA,UAAUI,cAAc,CAACD,KAAK;oBAChCH,SAAS,CAACG,GAAG,CAACD;gBAChB;YACF;QACF;QAEA,OAAOH;IACT;IAEA,OAAcM,kBAAkBC,EAAuB,EAAQ;QAC7D,yGAAyG;QACzG,kGAAkG;QAClG,IAAIH,KAAKG,GAAGC,MAAM;QAClB,MAAMP,YAAYQ;QAElB,IAAI,CAACL,IAAI;YACPA,KAAKG,GAAGC,MAAM,GAAGE,OAAOnB;QAC1B;QAEAU,SAAS,CAACG,GAAG,GAAGG;IAClB;IAEA,OAAcI,qBAAqBJ,EAAuB,EAAQ;QAChE,MAAMN,YAAYQ;QAClB,OAAOR,SAAS,CAACM,GAAGC,MAAM,CAAW;IACvC;AACF;AAEA,8DAA8D;AAC9D,SAASX;IACP,MAAMe,MAAMxB;IACZ,8DAA8D;IAC9D,MAAMyB,YAAoCD,OAAO,CAAC;IAElD,IAAI,CAACC,SAAS,CAACxB,0BAA0B,EAAE;QACzCwB,SAAS,CAACxB,0BAA0B,GAAG;YACrC,CAACC,yBAAyB,EAAE,CAAC;QAC/B;IACF;IAEA,OAAOuB,SAAS,CAACxB,0BAA0B;AAC7C;AAEA,SAASoB;IACP,MAAMb,iBAAiBC;IACvB,OAAOD,cAAc,CAACN,yBAAyB;AACjD"}
1
+ {"version":3,"sources":["../src/GlobalSettings.ts"],"sourcesContent":["import { getWindow } from './getWindow';\n\n/**\n * Storing global state in local module variables has issues when more than one copy\n * of the module gets loaded on the page (due to a bundling error or simply by consuming\n * a prebundled script.)\n *\n * This file contains helpers to deal with the getting and setting local state, and allows\n * callers to get called back when it mutates.\n */\n\nconst GLOBAL_SETTINGS_PROP_NAME = '__globalSettings__';\nconst CALLBACK_STATE_PROP_NAME = '__callbacks__';\n\nlet _counter = 0;\n\n/**\n * Change description used for change callbacks in GlobalSettings.\n *\n * @public\n */\nexport interface ChangeDescription {\n key: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n oldValue: any;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value: any;\n}\n\n/**\n * Change event callback.\n *\n * @public\n */\nexport interface ChangeEventCallback {\n __id__?: string;\n (changeDescription?: ChangeDescription): void;\n}\n\n/**\n * Global settings helper, which stores settings in the global (window) namespace.\n * If window is not provided, it will store settings in module scope. Provides a\n * way to observe changes as well when their values change.\n *\n * @public\n */\nexport class GlobalSettings {\n public static getValue<T>(key: string, defaultValue?: T | (() => T)): T {\n const globalSettings = _getGlobalSettings();\n\n if (globalSettings[key] === undefined) {\n globalSettings[key] = typeof defaultValue === 'function' ? (defaultValue as Function)() : defaultValue;\n }\n\n return globalSettings[key];\n }\n\n public static setValue<T>(key: string, value: T): T {\n const globalSettings = _getGlobalSettings();\n const callbacks = globalSettings[CALLBACK_STATE_PROP_NAME];\n const oldValue = globalSettings[key];\n\n if (value !== oldValue) {\n globalSettings[key] = value;\n\n const changeDescription = {\n oldValue,\n value,\n key,\n };\n\n for (const id in callbacks) {\n if (callbacks.hasOwnProperty(id)) {\n callbacks[id](changeDescription);\n }\n }\n }\n\n return value;\n }\n\n public static addChangeListener(cb: ChangeEventCallback): void {\n // Note: we use generated ids on the callbacks to create a map of the callbacks, which optimizes removal.\n // (It's faster to delete a key than it is to look up the index of an object and splice an array.)\n let id = cb.__id__;\n const callbacks = _getCallbacks();\n\n if (!id) {\n id = cb.__id__ = String(_counter++);\n }\n\n callbacks[id] = cb;\n }\n\n public static removeChangeListener(cb: ChangeEventCallback): void {\n const callbacks = _getCallbacks();\n delete callbacks[cb.__id__ as string];\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction _getGlobalSettings(): { [key: string]: any } {\n const win = getWindow();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const globalObj: { [key: string]: any } = win || {};\n\n if (!globalObj[GLOBAL_SETTINGS_PROP_NAME]) {\n globalObj[GLOBAL_SETTINGS_PROP_NAME] = {\n [CALLBACK_STATE_PROP_NAME]: {},\n };\n }\n\n return globalObj[GLOBAL_SETTINGS_PROP_NAME];\n}\n\nfunction _getCallbacks(): { [key: string]: () => void } {\n const globalSettings = _getGlobalSettings();\n return globalSettings[CALLBACK_STATE_PROP_NAME];\n}\n"],"names":["getWindow","GLOBAL_SETTINGS_PROP_NAME","CALLBACK_STATE_PROP_NAME","_counter","GlobalSettings","getValue","key","defaultValue","globalSettings","_getGlobalSettings","undefined","setValue","value","callbacks","oldValue","changeDescription","id","hasOwnProperty","addChangeListener","cb","__id__","_getCallbacks","String","removeChangeListener","win","globalObj"],"mappings":"AAAA,SAASA,SAAS,QAAQ,iBAAc;AAExC;;;;;;;CAOC,GAED,MAAMC,4BAA4B;AAClC,MAAMC,2BAA2B;AAEjC,IAAIC,WAAW;AAyBf;;;;;;CAMC,GACD,OAAO,MAAMC;IACX,OAAcC,SAAYC,GAAW,EAAEC,YAA4B,EAAK;QACtE,MAAMC,iBAAiBC;QAEvB,IAAID,cAAc,CAACF,IAAI,KAAKI,WAAW;YACrCF,cAAc,CAACF,IAAI,GAAG,OAAOC,iBAAiB,aAAa,AAACA,iBAA8BA;QAC5F;QAEA,OAAOC,cAAc,CAACF,IAAI;IAC5B;IAEA,OAAcK,SAAYL,GAAW,EAAEM,KAAQ,EAAK;QAClD,MAAMJ,iBAAiBC;QACvB,MAAMI,YAAYL,cAAc,CAACN,yBAAyB;QAC1D,MAAMY,WAAWN,cAAc,CAACF,IAAI;QAEpC,IAAIM,UAAUE,UAAU;YACtBN,cAAc,CAACF,IAAI,GAAGM;YAEtB,MAAMG,oBAAoB;gBACxBD;gBACAF;gBACAN;YACF;YAEA,IAAK,MAAMU,MAAMH,UAAW;gBAC1B,IAAIA,UAAUI,cAAc,CAACD,KAAK;oBAChCH,SAAS,CAACG,GAAG,CAACD;gBAChB;YACF;QACF;QAEA,OAAOH;IACT;IAEA,OAAcM,kBAAkBC,EAAuB,EAAQ;QAC7D,yGAAyG;QACzG,kGAAkG;QAClG,IAAIH,KAAKG,GAAGC,MAAM;QAClB,MAAMP,YAAYQ;QAElB,IAAI,CAACL,IAAI;YACPA,KAAKG,GAAGC,MAAM,GAAGE,OAAOnB;QAC1B;QAEAU,SAAS,CAACG,GAAG,GAAGG;IAClB;IAEA,OAAcI,qBAAqBJ,EAAuB,EAAQ;QAChE,MAAMN,YAAYQ;QAClB,OAAOR,SAAS,CAACM,GAAGC,MAAM,CAAW;IACvC;AACF;AAEA,8DAA8D;AAC9D,SAASX;IACP,MAAMe,MAAMxB;IACZ,8DAA8D;IAC9D,MAAMyB,YAAoCD,OAAO,CAAC;IAElD,IAAI,CAACC,SAAS,CAACxB,0BAA0B,EAAE;QACzCwB,SAAS,CAACxB,0BAA0B,GAAG;YACrC,CAACC,yBAAyB,EAAE,CAAC;QAC/B;IACF;IAEA,OAAOuB,SAAS,CAACxB,0BAA0B;AAC7C;AAEA,SAASoB;IACP,MAAMb,iBAAiBC;IACvB,OAAOD,cAAc,CAACN,yBAAyB;AACjD"}
package/lib/getWindow.js CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { canUseDOM } from '@fluentui/react-utilities';
2
+ import { canUseDOM } from "@fluentui/react-utilities";
3
3
  let _window = undefined;
4
4
  // Note: Accessing "window" in IE11 is somewhat expensive, and calling "typeof window"
5
5
  // hits a memory leak, whereas aliasing it and calling "typeof _window" does not.
package/lib/icon.js CHANGED
@@ -1,4 +1,4 @@
1
- import { GlobalSettings } from './GlobalSettings';
1
+ import { GlobalSettings } from "./GlobalSettings.js";
2
2
  const ICON_SETTING_NAME = 'icons';
3
3
  const _iconSettings = GlobalSettings.getValue(ICON_SETTING_NAME, {
4
4
  __options: {
package/lib/icon.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/icon.ts"],"sourcesContent":["import type * as React from 'react';\nimport { GlobalSettings } from './GlobalSettings';\nimport type { JSXElement } from '@fluentui/react-utilities';\n\nexport type T = React.ReactNode;\n\nexport interface IconSubset {\n icons: {\n [key: string]: string | JSXElement;\n };\n /**\n * Indicates to the icon renderer that it is safe to merge any props on the original `Icon` element\n * onto the child content element registered for the icon which are valid for HTML images.\n */\n mergeImageProps?: boolean;\n}\n\nexport interface IconSubsetRecord extends IconSubset {\n isRegistered?: boolean;\n className?: string;\n}\n\nexport interface IconRecord {\n code: string | undefined;\n subset: IconSubsetRecord;\n}\n\nexport interface IconOptions {\n /**\n * By default, registering the same set of icons will generate a console warning per duplicate icon\n * registered, because this scenario can create unexpected consequences.\n *\n * Some scenarios include:\n *\n * Icon set was previously registered using a different base url.\n * Icon set was previously registered but a different version was provided.\n * Icons in a previous registered set overlap with a new set.\n *\n * To simply ignore previously registered icons, you can specify to disable warnings. This means\n * that if an icon which was previous registered is registered again, it will be silently ignored.\n * However, consider whether the problems listed above will cause issues.\n **/\n disableWarnings: boolean;\n\n /**\n * @deprecated Use `disableWarnings` instead.\n */\n warnOnMissingIcons?: boolean;\n}\n\nexport interface IconRecords {\n __options: IconOptions;\n __remapped: { [key: string]: string };\n [key: string]: IconRecord | {};\n}\n\nconst ICON_SETTING_NAME = 'icons';\n\nconst _iconSettings = GlobalSettings.getValue<IconRecords>(ICON_SETTING_NAME, {\n __options: {\n disableWarnings: false,\n warnOnMissingIcons: true,\n },\n __remapped: {},\n});\n\n/**\n * Normalizes an icon name for consistent mapping.\n * Current implementation is to convert the icon name to lower case.\n *\n * @param name - Icon name to normalize.\n * @returns {string} Normalized icon name to use for indexing and mapping.\n */\nconst normalizeIconName = (name: string): string => name.toLowerCase();\n\n/**\n * Registers a given subset of icons.\n *\n * @param iconSubset - the icon subset definition.\n */\nexport function registerIcons(iconSubset: IconSubset, options?: Partial<IconOptions>): void {\n const subset = {\n ...iconSubset,\n isRegistered: false,\n className: undefined,\n };\n const { icons } = iconSubset;\n\n // Grab options, optionally mix user provided ones on top.\n options = options ? { ..._iconSettings.__options, ...options } : _iconSettings.__options;\n\n for (const iconName in icons) {\n if (icons.hasOwnProperty(iconName)) {\n const code = icons[iconName];\n const normalizedIconName = normalizeIconName(iconName);\n\n if (_iconSettings[normalizedIconName]) {\n _warnDuplicateIcon(iconName);\n } else {\n _iconSettings[normalizedIconName] = {\n code,\n subset,\n } as IconRecord;\n }\n }\n }\n}\n\n/**\n * Unregisters icons by name.\n *\n * @param iconNames - List of icons to unregister.\n */\nexport function unregisterIcons(iconNames: string[]): void {\n const options = _iconSettings.__options;\n\n for (const iconName of iconNames) {\n const normalizedIconName = normalizeIconName(iconName);\n if (_iconSettings[normalizedIconName]) {\n delete _iconSettings[normalizedIconName];\n } else {\n // Warn that we are trying to delete an icon that doesn't exist\n if (!options.disableWarnings) {\n // eslint-disable-next-line no-console\n console.warn(`The icon \"${iconName}\" tried to unregister but was not registered.`);\n }\n }\n\n // Delete any aliases for this iconName\n if (_iconSettings.__remapped[normalizedIconName]) {\n delete _iconSettings.__remapped[normalizedIconName];\n }\n\n // Delete any items that were an alias for this iconName\n Object.keys(_iconSettings.__remapped).forEach((key: string) => {\n if (_iconSettings.__remapped[key] === normalizedIconName) {\n delete _iconSettings.__remapped[key];\n }\n });\n }\n}\n\n/**\n * Remaps one icon name to another.\n */\nexport function registerIconAlias(iconName: string, mappedToName: string): void {\n _iconSettings.__remapped[normalizeIconName(iconName)] = normalizeIconName(mappedToName);\n}\n\n/**\n * Gets an icon definition. If an icon is requested but the subset has yet to be registered,\n * it will get registered immediately.\n *\n * @public\n * @param name - Name of icon.\n */\nexport function getIcon(name?: string): IconRecord | undefined {\n let icon: IconRecord | undefined = undefined;\n const options = _iconSettings.__options;\n\n name = name ? normalizeIconName(name) : '';\n name = _iconSettings.__remapped[name] || name;\n\n if (name) {\n icon = _iconSettings[name!] as IconRecord;\n\n if (icon) {\n const { subset } = icon;\n if (subset) {\n if (!subset.isRegistered) {\n subset.isRegistered = true;\n }\n }\n } else {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n if (!options.disableWarnings && options.warnOnMissingIcons) {\n // eslint-disable-next-line no-console\n console.warn(\n `The icon \"${name}\" was used but not registered. See https://github.com/microsoft/fluentui/wiki/Using-icons for more information.`,\n );\n }\n }\n }\n\n return icon;\n}\n\n/**\n * Sets the icon options.\n *\n * @public\n */\nexport function setIconOptions(options: Partial<IconOptions>): void {\n _iconSettings.__options = {\n ..._iconSettings.__options,\n ...options,\n };\n}\n\nlet _missingIcons: string[] = [];\n// TODO: exclude types from this lint rule: https://github.com/microsoft/fluentui/issues/31286\nlet _missingIconsTimer: ReturnType<typeof setTimeout> | undefined = undefined;\n\nfunction _warnDuplicateIcon(iconName: string): void {\n const options = _iconSettings.__options;\n const warningDelay = 2000;\n const maxIconsInMessage = 10;\n\n if (!options.disableWarnings) {\n _missingIcons.push(iconName);\n if (_missingIconsTimer === undefined) {\n _missingIconsTimer =\n // eslint-disable-next-line @nx/workspace-no-restricted-globals\n setTimeout(() => {\n // eslint-disable-next-line no-console\n console.warn(\n `Some icons were re-registered. Applications should only call registerIcons for any given ` +\n `icon once. Redefining what an icon is may have unintended consequences. Duplicates ` +\n `include: \\n` +\n _missingIcons.slice(0, maxIconsInMessage).join(', ') +\n (_missingIcons.length > maxIconsInMessage ? ` (+ ${_missingIcons.length - maxIconsInMessage} more)` : ''),\n );\n _missingIconsTimer = undefined;\n _missingIcons = [];\n }, warningDelay);\n }\n }\n}\n"],"names":["GlobalSettings","ICON_SETTING_NAME","_iconSettings","getValue","__options","disableWarnings","warnOnMissingIcons","__remapped","normalizeIconName","name","toLowerCase","registerIcons","iconSubset","options","subset","isRegistered","className","undefined","icons","iconName","hasOwnProperty","code","normalizedIconName","_warnDuplicateIcon","unregisterIcons","iconNames","console","warn","Object","keys","forEach","key","registerIconAlias","mappedToName","getIcon","icon","setIconOptions","_missingIcons","_missingIconsTimer","warningDelay","maxIconsInMessage","push","setTimeout","slice","join","length"],"mappings":"AACA,SAASA,cAAc,QAAQ,mBAAmB;AAuDlD,MAAMC,oBAAoB;AAE1B,MAAMC,gBAAgBF,eAAeG,QAAQ,CAAcF,mBAAmB;IAC5EG,WAAW;QACTC,iBAAiB;QACjBC,oBAAoB;IACtB;IACAC,YAAY,CAAC;AACf;AAEA;;;;;;CAMC,GACD,MAAMC,oBAAoB,CAACC,OAAyBA,KAAKC,WAAW;AAEpE;;;;CAIC,GACD,OAAO,SAASC,cAAcC,UAAsB,EAAEC,OAA8B;IAClF,MAAMC,SAAS;QACb,GAAGF,UAAU;QACbG,cAAc;QACdC,WAAWC;IACb;IACA,MAAM,EAAEC,KAAK,E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AI,CAAC,QAC9CP,CAAAA,cAAcQ,MAAM,GAAGL,oBAAoB,CAAC,IAAI,EAAEH,cAAcQ,MAAM,GAAGL,kBAAkB,MAAM,CAAC,GAAG,EAAC;gBAE3GF,qBAAqBrB;gBACrBoB,gBAAgB,EAAE;YACpB,GAAGE;QACP;IACF;AACF"}
1
+ {"version":3,"sources":["../src/icon.ts"],"sourcesContent":["import type * as React from 'react';\nimport { GlobalSettings } from './GlobalSettings';\nimport type { JSXElement } from '@fluentui/react-utilities';\n\nexport type T = React.ReactNode;\n\nexport interface IconSubset {\n icons: {\n [key: string]: string | JSXElement;\n };\n /**\n * Indicates to the icon renderer that it is safe to merge any props on the original `Icon` element\n * onto the child content element registered for the icon which are valid for HTML images.\n */\n mergeImageProps?: boolean;\n}\n\nexport interface IconSubsetRecord extends IconSubset {\n isRegistered?: boolean;\n className?: string;\n}\n\nexport interface IconRecord {\n code: string | undefined;\n subset: IconSubsetRecord;\n}\n\nexport interface IconOptions {\n /**\n * By default, registering the same set of icons will generate a console warning per duplicate icon\n * registered, because this scenario can create unexpected consequences.\n *\n * Some scenarios include:\n *\n * Icon set was previously registered using a different base url.\n * Icon set was previously registered but a different version was provided.\n * Icons in a previous registered set overlap with a new set.\n *\n * To simply ignore previously registered icons, you can specify to disable warnings. This means\n * that if an icon which was previous registered is registered again, it will be silently ignored.\n * However, consider whether the problems listed above will cause issues.\n **/\n disableWarnings: boolean;\n\n /**\n * @deprecated Use `disableWarnings` instead.\n */\n warnOnMissingIcons?: boolean;\n}\n\nexport interface IconRecords {\n __options: IconOptions;\n __remapped: { [key: string]: string };\n [key: string]: IconRecord | {};\n}\n\nconst ICON_SETTING_NAME = 'icons';\n\nconst _iconSettings = GlobalSettings.getValue<IconRecords>(ICON_SETTING_NAME, {\n __options: {\n disableWarnings: false,\n warnOnMissingIcons: true,\n },\n __remapped: {},\n});\n\n/**\n * Normalizes an icon name for consistent mapping.\n * Current implementation is to convert the icon name to lower case.\n *\n * @param name - Icon name to normalize.\n * @returns {string} Normalized icon name to use for indexing and mapping.\n */\nconst normalizeIconName = (name: string): string => name.toLowerCase();\n\n/**\n * Registers a given subset of icons.\n *\n * @param iconSubset - the icon subset definition.\n */\nexport function registerIcons(iconSubset: IconSubset, options?: Partial<IconOptions>): void {\n const subset = {\n ...iconSubset,\n isRegistered: false,\n className: undefined,\n };\n const { icons } = iconSubset;\n\n // Grab options, optionally mix user provided ones on top.\n options = options ? { ..._iconSettings.__options, ...options } : _iconSettings.__options;\n\n for (const iconName in icons) {\n if (icons.hasOwnProperty(iconName)) {\n const code = icons[iconName];\n const normalizedIconName = normalizeIconName(iconName);\n\n if (_iconSettings[normalizedIconName]) {\n _warnDuplicateIcon(iconName);\n } else {\n _iconSettings[normalizedIconName] = {\n code,\n subset,\n } as IconRecord;\n }\n }\n }\n}\n\n/**\n * Unregisters icons by name.\n *\n * @param iconNames - List of icons to unregister.\n */\nexport function unregisterIcons(iconNames: string[]): void {\n const options = _iconSettings.__options;\n\n for (const iconName of iconNames) {\n const normalizedIconName = normalizeIconName(iconName);\n if (_iconSettings[normalizedIconName]) {\n delete _iconSettings[normalizedIconName];\n } else {\n // Warn that we are trying to delete an icon that doesn't exist\n if (!options.disableWarnings) {\n // eslint-disable-next-line no-console\n console.warn(`The icon \"${iconName}\" tried to unregister but was not registered.`);\n }\n }\n\n // Delete any aliases for this iconName\n if (_iconSettings.__remapped[normalizedIconName]) {\n delete _iconSettings.__remapped[normalizedIconName];\n }\n\n // Delete any items that were an alias for this iconName\n Object.keys(_iconSettings.__remapped).forEach((key: string) => {\n if (_iconSettings.__remapped[key] === normalizedIconName) {\n delete _iconSettings.__remapped[key];\n }\n });\n }\n}\n\n/**\n * Remaps one icon name to another.\n */\nexport function registerIconAlias(iconName: string, mappedToName: string): void {\n _iconSettings.__remapped[normalizeIconName(iconName)] = normalizeIconName(mappedToName);\n}\n\n/**\n * Gets an icon definition. If an icon is requested but the subset has yet to be registered,\n * it will get registered immediately.\n *\n * @public\n * @param name - Name of icon.\n */\nexport function getIcon(name?: string): IconRecord | undefined {\n let icon: IconRecord | undefined = undefined;\n const options = _iconSettings.__options;\n\n name = name ? normalizeIconName(name) : '';\n name = _iconSettings.__remapped[name] || name;\n\n if (name) {\n icon = _iconSettings[name!] as IconRecord;\n\n if (icon) {\n const { subset } = icon;\n if (subset) {\n if (!subset.isRegistered) {\n subset.isRegistered = true;\n }\n }\n } else {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n if (!options.disableWarnings && options.warnOnMissingIcons) {\n // eslint-disable-next-line no-console\n console.warn(\n `The icon \"${name}\" was used but not registered. See https://github.com/microsoft/fluentui/wiki/Using-icons for more information.`,\n );\n }\n }\n }\n\n return icon;\n}\n\n/**\n * Sets the icon options.\n *\n * @public\n */\nexport function setIconOptions(options: Partial<IconOptions>): void {\n _iconSettings.__options = {\n ..._iconSettings.__options,\n ...options,\n };\n}\n\nlet _missingIcons: string[] = [];\n// TODO: exclude types from this lint rule: https://github.com/microsoft/fluentui/issues/31286\nlet _missingIconsTimer: ReturnType<typeof setTimeout> | undefined = undefined;\n\nfunction _warnDuplicateIcon(iconName: string): void {\n const options = _iconSettings.__options;\n const warningDelay = 2000;\n const maxIconsInMessage = 10;\n\n if (!options.disableWarnings) {\n _missingIcons.push(iconName);\n if (_missingIconsTimer === undefined) {\n _missingIconsTimer =\n // eslint-disable-next-line @nx/workspace-no-restricted-globals\n setTimeout(() => {\n // eslint-disable-next-line no-console\n console.warn(\n `Some icons were re-registered. Applications should only call registerIcons for any given ` +\n `icon once. Redefining what an icon is may have unintended consequences. Duplicates ` +\n `include: \\n` +\n _missingIcons.slice(0, maxIconsInMessage).join(', ') +\n (_missingIcons.length > maxIconsInMessage ? ` (+ ${_missingIcons.length - maxIconsInMessage} more)` : ''),\n );\n _missingIconsTimer = undefined;\n _missingIcons = [];\n }, warningDelay);\n }\n }\n}\n"],"names":["GlobalSettings","ICON_SETTING_NAME","_iconSettings","getValue","__options","disableWarnings","warnOnMissingIcons","__remapped","normalizeIconName","name","toLowerCase","registerIcons","iconSubset","options","subset","isRegistered","className","undefined","icons","iconName","hasOwnProperty","code","normalizedIconName","_warnDuplicateIcon","unregisterIcons","iconNames","console","warn","Object","keys","forEach","key","registerIconAlias","mappedToName","getIcon","icon","setIconOptions","_missingIcons","_missingIconsTimer","warningDelay","maxIconsInMessage","push","setTimeout","slice","join","length"],"mappings":"AACA,SAASA,cAAc,QAAQ,sBAAmB;AAuDlD,MAAMC,oBAAoB;AAE1B,MAAMC,gBAAgBF,eAAeG,QAAQ,CAAcF,mBAAmB;IAC5EG,WAAW;QACTC,iBAAiB;QACjBC,oBAAoB;IACtB;IACAC,YAAY,CAAC;AACf;AAEA;;;;;;CAMC,GACD,MAAMC,oBAAoB,CAACC,OAAyBA,KAAKC,WAAW;AAEpE;;;;CAIC,GACD,OAAO,SAASC,cAAcC,UAAsB,EAAEC,OAA8B;IAClF,MAAMC,SAAS;QACb,GAAGF,UAAU;QACbG,cAAc;QACdC,WAAWC;IACb;IACA,MAAM,EAAEC,KAAK,EAAE,GAAGN;IAElB,0DAA0D;IAC1DC,UAAUA,UAAU;QAAE,GAAGX,cAAcE,SAAS;QAAE,GAAGS,OAAO;IAAC,IAAIX,cAAcE,SAAS;IAExF,IAAK,MAAMe,YAAYD,MAAO;QAC5B,IAAIA,MAAME,cAAc,CAACD,WAAW;YAClC,MAAME,OAAOH,KAAK,CAACC,SAAS;YAC5B,MAAMG,qBAAqBd,kBAAkBW;YAE7C,IAAIjB,aAAa,CAACoB,mBAAmB,EAAE;gBACrCC,mBAAmBJ;YACrB,OAAO;gBACLjB,aAAa,CAACoB,mBAAmB,GAAG;oBAClCD;oBACAP;gBACF;YACF;QACF;IACF;AACF;AAEA;;;;CAIC,GACD,OAAO,SAASU,gBAAgBC,SAAmB;IACjD,MAAMZ,UAAUX,cAAcE,SAAS;IAEvC,KAAK,MAAMe,YAAYM,UAAW;QAChC,MAAMH,qBAAqBd,kBAAkBW;QAC7C,IAAIjB,aAAa,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,CAAC;YAEtI;QACF;IACF;IAEA,OAAO0B;AACT;AAEA;;;;CAIC,GACD,OAAO,SAASC,eAAevB,OAA6B;IAC1DX,cAAcE,SAAS,GAAG;QACxB,GAAGF,cAAcE,SAAS;QAC1B,GAAGS,OAAO;IACZ;AACF;AAEA,IAAIwB,gBAA0B,EAAE;AAChC,8FAA8F;AAC9F,IAAIC,qBAAgErB;AAEpE,SAASM,mBAAmBJ,QAAgB;IAC1C,MAAMN,UAAUX,cAAcE,SAAS;IACvC,MAAMmC,eAAe;IACrB,MAAMC,oBAAoB;IAE1B,IAAI,CAAC3B,QAAQR,eAAe,EAAE;QAC5BgC,cAAcI,IAAI,CAACtB;QACnB,IAAImB,uBAAuBrB,WAAW;YACpCqB,qBACE,+DAA+D;YAC/DI,WAAW;gBACT,sCAAsC;gBACtChB,QAAQC,IAAI,CACV,CAAC,yFAAyF,CAAC,GACzF,CAAC,mFAAmF,CAAC,GACrF,CAAC,WAAW,CAAC,GACbU,cAAcM,KAAK,CAAC,GAAGH,mBAAmBI,IAAI,CAAC,QAC9CP,CAAAA,cAAcQ,MAAM,GAAGL,oBAAoB,CAAC,IAAI,EAAEH,cAAcQ,MAAM,GAAGL,kBAAkB,MAAM,CAAC,GAAG,EAAC;gBAE3GF,qBAAqBrB;gBACrBoB,gBAAgB,EAAE;YACpB,GAAGE;QACP;IACF;AACF"}
package/lib/index.js CHANGED
@@ -1 +1 @@
1
- export { registerIcons, registerIconAlias, unregisterIcons, getIcon, setIconOptions } from './icon';
1
+ export { registerIcons, registerIconAlias, unregisterIcons, getIcon, setIconOptions } from "./icon.js";
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { registerIcons, registerIconAlias, unregisterIcons, getIcon, setIconOptions } from './icon';\nexport type { IconRecord, IconOptions, IconSubset, IconSubsetRecord, IconRecords } from './icon';\n"],"names":["registerIcons","registerIconAlias","unregisterIcons","getIcon","setIconOptions"],"mappings":"AAAA,SAASA,aAAa,EAAEC,iBAAiB,EAAEC,eAAe,EAAEC,OAAO,EAAEC,cAAc,QAAQ,SAAS"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { registerIcons, registerIconAlias, unregisterIcons, getIcon, setIconOptions } from './icon';\nexport type { IconRecord, IconOptions, IconSubset, IconSubsetRecord, IconRecords } from './icon';\n"],"names":["registerIcons","registerIconAlias","unregisterIcons","getIcon","setIconOptions"],"mappings":"AAAA,SAASA,aAAa,EAAEC,iBAAiB,EAAEC,eAAe,EAAEC,OAAO,EAAEC,cAAc,QAAQ,YAAS"}
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "GlobalSettings", {
8
8
  return GlobalSettings;
9
9
  }
10
10
  });
11
- const _getWindow = require("./getWindow");
11
+ const _getWindow = require("./getWindow.cjs");
12
12
  /**
13
13
  * Storing global state in local module variables has issues when more than one copy
14
14
  * of the module gets loaded on the page (due to a bundling error or simply by consuming
@@ -25,7 +25,7 @@ _export(exports, {
25
25
  return unregisterIcons;
26
26
  }
27
27
  });
28
- const _GlobalSettings = require("./GlobalSettings");
28
+ const _GlobalSettings = require("./GlobalSettings.cjs");
29
29
  const ICON_SETTING_NAME = 'icons';
30
30
  const _iconSettings = _GlobalSettings.GlobalSettings.getValue(ICON_SETTING_NAME, {
31
31
  __options: {
@@ -25,4 +25,4 @@ _export(exports, {
25
25
  return _icon.unregisterIcons;
26
26
  }
27
27
  });
28
- const _icon = require("./icon");
28
+ const _icon = require("./icon.cjs");
package/package.json CHANGED
@@ -1,14 +1,15 @@
1
1
  {
2
2
  "name": "@fluentui/react-icons-compat",
3
- "version": "0.2.21",
3
+ "version": "0.2.23",
4
4
  "description": "Package for icon utility methods used by font and svg icons.",
5
- "main": "lib-commonjs/index.js",
5
+ "main": "lib-commonjs/index.cjs",
6
6
  "module": "lib/index.js",
7
7
  "typings": "./dist/index.d.ts",
8
8
  "sideEffects": false,
9
9
  "files": [
10
10
  "*.md",
11
11
  "dist/*.d.ts",
12
+ "dist/*.d.cts",
12
13
  "lib",
13
14
  "lib-commonjs"
14
15
  ],
@@ -18,25 +19,29 @@
18
19
  },
19
20
  "license": "MIT",
20
21
  "dependencies": {
21
- "@fluentui/react-jsx-runtime": "^9.4.4",
22
- "@fluentui/react-shared-contexts": "^9.26.2",
23
- "@fluentui/react-theme": "^9.2.1",
24
- "@fluentui/react-utilities": "^9.26.5",
22
+ "@fluentui/react-jsx-runtime": "^9.4.5",
23
+ "@fluentui/react-shared-contexts": "^9.26.3",
24
+ "@fluentui/react-theme": "^9.2.2",
25
+ "@fluentui/react-utilities": "^9.26.6",
25
26
  "@griffel/react": "^1.5.32",
26
27
  "@swc/helpers": "^0.5.1"
27
28
  },
28
29
  "peerDependencies": {
29
- "@types/react": ">=16.8.0 <20.0.0",
30
- "@types/react-dom": ">=16.8.0 <20.0.0",
31
- "react": ">=16.8.0 <20.0.0",
32
- "react-dom": ">=16.8.0 <20.0.0"
30
+ "@types/react": ">=16.14.0 <20.0.0",
31
+ "@types/react-dom": ">=16.9.0 <20.0.0",
32
+ "react": ">=16.14.0 <20.0.0",
33
+ "react-dom": ">=16.14.0 <20.0.0"
33
34
  },
34
35
  "exports": {
35
36
  ".": {
36
- "types": "./dist/index.d.ts",
37
- "node": "./lib-commonjs/index.js",
38
- "import": "./lib/index.js",
39
- "require": "./lib-commonjs/index.js"
37
+ "import": {
38
+ "types": "./dist/index.d.ts",
39
+ "default": "./lib/index.js"
40
+ },
41
+ "require": {
42
+ "types": "./dist/index.d.cts",
43
+ "default": "./lib-commonjs/index.cjs"
44
+ }
40
45
  },
41
46
  "./package.json": "./package.json"
42
47
  },
@@ -45,5 +50,6 @@
45
50
  "major",
46
51
  "prerelease"
47
52
  ]
48
- }
53
+ },
54
+ "type": "module"
49
55
  }
File without changes
File without changes
File without changes