@iress-oss/ids-components 6.4.3 → 6.4.5

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.
@@ -46,6 +46,10 @@ For more simpler applications, or if you need to customise the icon provider ind
46
46
 
47
47
  > **Note:** If you are already using `IressProvider` or `IressShadow`, you do not need to add `IressIconProvider` separately — it is already included.
48
48
 
49
+ With automatic loading, icons remain hidden while their font is loading or if
50
+ the download fails. Their space is reserved so icon names do not appear as text
51
+ or overlap nearby content.
52
+
49
53
  ```tsx
50
54
  const [showMoreIcons, setShowMoreIcons] = useState(false);
51
55
  const [showEvenMore, setShowEvenMore] = useState(false);
@@ -4,6 +4,7 @@ import { ReactNode, MouseEvent } from 'react';
4
4
  import { Statuses } from '../../types';
5
5
  import { IressButtonProps } from '../Button';
6
6
  export interface IressAlertButtonProps extends Omit<IressButtonProps, 'mode' | 'status'> {
7
+ [attribute: `data-${string}`]: unknown;
7
8
  mode?: 'secondary' | 'tertiary';
8
9
  }
9
10
  export interface IressAlertProps extends Omit<IressTextProps, 'element'> {
@@ -29,16 +29,15 @@ var o = (e, t, n) => {
29
29
  C,
30
30
  h
31
31
  ]), T = n((e) => {
32
- t(`[useDynamicFontSubsetting] Failed to load font "${p}" for icons: ${e.join(", ")}. Icons will render as text after timeout.`), setTimeout(() => {
33
- S(e);
34
- }, 3e3);
35
- }, [S, p]), E = n((e, t) => {
36
- "fonts" in document ? (document.fonts.check(`24px "${p}"`) ? Promise.resolve() : document.fonts.load(`24px "${p}"`)).then(() => w(e, t)).catch(() => T(t)) : setTimeout(() => S(t), 1e3);
32
+ t(`[useDynamicFontSubsetting] Failed to load font "${p}" for icons: ${e.join(", ")}. Icons will remain hidden until the font loads.`);
33
+ }, [p]), E = n((e, t) => {
34
+ "fonts" in document && document.fonts.load(`24px "${p}"`).then((n) => {
35
+ n.length > 0 && w(e, t);
36
+ }).catch(() => T(t));
37
37
  }, [
38
38
  p,
39
39
  w,
40
- T,
41
- S
40
+ T
42
41
  ]);
43
42
  return r(() => () => {
44
43
  document.querySelectorAll(`link[data-${f}="${x.current}"]`).forEach((e) => e.parentNode?.removeChild(e));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iress-oss/ids-components",
3
- "version": "6.4.3",
3
+ "version": "6.4.5",
4
4
  "description": "Iress React Component Library",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",