@mantine/code-highlight 7.0.0-alpha.8 → 7.0.0-beta.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/cjs/CodeHighlight.js +1 -21
- package/cjs/CodeHighlight.js.map +1 -1
- package/cjs/CodeHighlight.module.css.js +1 -2
- package/cjs/CodeHighlight.module.css.js.map +1 -1
- package/cjs/CodeHighlight.theme.module.css.js +1 -2
- package/cjs/CodeHighlight.theme.module.css.js.map +1 -1
- package/cjs/CodeHighlightTabs.js +40 -50
- package/cjs/CodeHighlightTabs.js.map +1 -1
- package/cjs/CopyIcon.js +14 -25
- package/cjs/CopyIcon.js.map +1 -1
- package/cjs/ExpandIcon.js +14 -39
- package/cjs/ExpandIcon.js.map +1 -1
- package/cjs/FileIcon.js +3 -4
- package/cjs/FileIcon.js.map +1 -1
- package/cjs/InlineCodeHighlight.js +9 -7
- package/cjs/InlineCodeHighlight.js.map +1 -1
- package/cjs/index.css +81 -118
- package/cjs/use-highlight.js +3 -2
- package/cjs/use-highlight.js.map +1 -1
- package/esm/CodeHighlight.js +1 -21
- package/esm/CodeHighlight.js.map +1 -1
- package/esm/CodeHighlight.module.css.js +1 -2
- package/esm/CodeHighlight.module.css.js.map +1 -1
- package/esm/CodeHighlight.theme.module.css.js +1 -2
- package/esm/CodeHighlight.theme.module.css.js.map +1 -1
- package/esm/CodeHighlightTabs.js +40 -50
- package/esm/CodeHighlightTabs.js.map +1 -1
- package/esm/CopyIcon.js +14 -25
- package/esm/CopyIcon.js.map +1 -1
- package/esm/ExpandIcon.js +14 -39
- package/esm/ExpandIcon.js.map +1 -1
- package/esm/FileIcon.js +3 -4
- package/esm/FileIcon.js.map +1 -1
- package/esm/InlineCodeHighlight.js +9 -7
- package/esm/InlineCodeHighlight.js.map +1 -1
- package/esm/index.css +81 -118
- package/esm/use-highlight.js +3 -2
- package/esm/use-highlight.js.map +1 -1
- package/lib/CodeHighlight.d.ts +0 -3
- package/lib/CodeHighlightTabs.d.ts +1 -2
- package/lib/CopyIcon.d.ts +1 -1
- package/lib/ExpandIcon.d.ts +1 -1
- package/lib/FileIcon.d.ts +3 -1
- package/lib/InlineCodeHighlight.d.ts +0 -1
- package/lib/index.d.ts +3 -3
- package/package.json +7 -6
- package/src/CodeHighlight.module.css +14 -1
- package/src/CodeHighlight.story.tsx +6 -0
- package/src/CodeHighlight.tsx +1 -3
- package/src/CodeHighlightTabs.tsx +9 -4
- package/src/FileIcon.tsx +13 -3
- package/src/InlineCodeHighlight.tsx +0 -1
- package/src/index.ts +0 -3
- package/tsconfig.build.tsbuildinfo +1 -1
package/src/FileIcon.tsx
CHANGED
|
@@ -4,15 +4,25 @@ interface FileIconProps {
|
|
|
4
4
|
fileName: string | undefined;
|
|
5
5
|
getFileIcon?: ((fileName: string) => React.ReactNode) | undefined;
|
|
6
6
|
fileIcon: React.ReactNode | undefined;
|
|
7
|
+
className?: string;
|
|
8
|
+
style?: React.CSSProperties;
|
|
7
9
|
}
|
|
8
10
|
|
|
9
|
-
export function FileIcon({ fileIcon, fileName, getFileIcon }: FileIconProps) {
|
|
11
|
+
export function FileIcon({ fileIcon, fileName, getFileIcon, className, style }: FileIconProps) {
|
|
10
12
|
if (fileIcon) {
|
|
11
|
-
return
|
|
13
|
+
return (
|
|
14
|
+
<span className={className} style={style}>
|
|
15
|
+
{fileIcon}
|
|
16
|
+
</span>
|
|
17
|
+
);
|
|
12
18
|
}
|
|
13
19
|
|
|
14
20
|
if (getFileIcon && fileName) {
|
|
15
|
-
return
|
|
21
|
+
return (
|
|
22
|
+
<span className={className} style={style}>
|
|
23
|
+
{getFileIcon(fileName)}
|
|
24
|
+
</span>
|
|
25
|
+
);
|
|
16
26
|
}
|
|
17
27
|
|
|
18
28
|
return null;
|
|
@@ -17,7 +17,6 @@ import themeClasses from './CodeHighlight.theme.module.css';
|
|
|
17
17
|
const classes = { ..._classes, code: cx(_classes.code, themeClasses.theme) };
|
|
18
18
|
|
|
19
19
|
export type InlineCodeHighlightStylesNames = 'code';
|
|
20
|
-
export type InlineCodeHighlightVariant = string;
|
|
21
20
|
|
|
22
21
|
export interface InlineCodeHighlightProps
|
|
23
22
|
extends BoxProps,
|
package/src/index.ts
CHANGED
|
@@ -6,18 +6,15 @@ export type {
|
|
|
6
6
|
CodeHighlightTabsStylesNames,
|
|
7
7
|
CodeHighlightTabsProps,
|
|
8
8
|
CodeHighlightTabsCode,
|
|
9
|
-
CodeHighlightTabsVariant,
|
|
10
9
|
CodeHighlightTabsCssVariables,
|
|
11
10
|
} from './CodeHighlightTabs';
|
|
12
11
|
export type {
|
|
13
12
|
CodeHighlightFactory,
|
|
14
13
|
CodeHighlightProps,
|
|
15
14
|
CodeHighlightStylesNames,
|
|
16
|
-
CodeHighlightVariant,
|
|
17
15
|
} from './CodeHighlight';
|
|
18
16
|
export type {
|
|
19
17
|
InlineCodeHighlightFactory,
|
|
20
18
|
InlineCodeHighlightProps,
|
|
21
19
|
InlineCodeHighlightStylesNames,
|
|
22
|
-
InlineCodeHighlightVariant,
|
|
23
20
|
} from './InlineCodeHighlight';
|