@illuma-ai/icons 2.3.0 → 2.4.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.
@@ -23,12 +23,19 @@ export interface ArtifactIconProps extends Omit<SVGProps<SVGSVGElement>, 'childr
23
23
  type?: string;
24
24
  /** Artifact language (e.g. `react`, `html`, `python`) — fallback when no type. */
25
25
  language?: string;
26
+ /**
27
+ * The artifact's real filename. Takes precedence over `type`/`language` so a
28
+ * `.docx` shows the Word icon even though its preview is rendered to PDF.
29
+ */
30
+ filename?: string;
26
31
  /** Pixel size for width and height. Defaults to 24. */
27
32
  size?: number;
28
33
  }
29
34
  /**
30
- * Icon for a side-panel code/document artifact, resolved from its type/language
31
- * rather than a filename (a React artifact react icon, HTML html, etc.).
35
+ * Icon for a side-panel code/document artifact. Resolved from the real filename
36
+ * first (source of truth), then artifact type/language so a React artifact
37
+ * react icon, an HTML artifact → html, and a `.docx` → Word (not PDF, even
38
+ * though its preview is rendered to PDF).
32
39
  */
33
40
  export declare const ArtifactIcon: import('react').ForwardRefExoticComponent<Omit<ArtifactIconProps, "ref"> & import('react').RefAttributes<SVGSVGElement>>;
34
41
  export interface AnimatedFileIconProps {
@@ -1,14 +1,22 @@
1
1
  import { FILE_ICONS, FileIconName, FileIconData } from './icons.generated';
2
2
  /** Generic fallback for unknown/other file types (Office 365 mark). */
3
3
  export declare const DEFAULT_FILE_ICON: FileIconName;
4
- /**
5
- * Resolve an artifact's icon from its `type` and/or `language`. Resolution
6
- * order: artifact type → language → {@link DEFAULT_FILE_ICON}.
7
- */
8
- export declare function resolveArtifactIcon(type?: string, language?: string): ResolvedFileIcon;
9
4
  export interface ResolvedFileIcon extends FileIconData {
10
5
  readonly name: FileIconName;
11
6
  }
7
+ /**
8
+ * Resolve an artifact's icon. The real file is the source of truth, so a
9
+ * `filename` (when present) wins — a `.docx` shows the Word icon even though its
10
+ * side-panel PREVIEW is rendered to PDF. Resolution order:
11
+ * filename extension → artifact type → language → {@link DEFAULT_FILE_ICON}.
12
+ *
13
+ * @param type artifact type identifier (e.g. `application/vnd.react`); note that
14
+ * office docs carry a `*-pdf-preview`/`*-preview` type reflecting how they're
15
+ * rendered, NOT the source format — which is why `filename` is checked first.
16
+ * @param language artifact language (e.g. `react`, `python`)
17
+ * @param filename the artifact's real filename, when known
18
+ */
19
+ export declare function resolveArtifactIcon(type?: string, language?: string, filename?: string): ResolvedFileIcon;
12
20
  /**
13
21
  * Resolve a file's icon from its filename and/or MIME type. Resolution order:
14
22
  * exact extension → exact MIME → {@link DEFAULT_FILE_ICON}.