@mks2508/mks-ui 0.7.0 → 0.8.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.
Files changed (109) hide show
  1. package/dist/css/primitives-DotMatrix-dot.css +364 -0
  2. package/dist/css/primitives-GooeyMorphingSurface-gooey.css +112 -0
  3. package/dist/css/ui-GooeyButton-gooey.css +43 -0
  4. package/dist/index.css +531 -0
  5. package/dist/react-ui/components/MorphingPopover/MorphingPopover.types.d.ts +8 -3
  6. package/dist/react-ui/components/MorphingPopover/MorphingPopover.types.d.ts.map +1 -1
  7. package/dist/react-ui/index.js +24 -1
  8. package/dist/react-ui/primitives/DotMatrix/DotMatrix.types.d.ts +109 -0
  9. package/dist/react-ui/primitives/DotMatrix/DotMatrix.types.d.ts.map +1 -0
  10. package/dist/react-ui/primitives/DotMatrix/dot-matrix.js +0 -0
  11. package/dist/react-ui/primitives/DotMatrix/dot.css +364 -0
  12. package/dist/react-ui/primitives/DotMatrix/index.d.ts +7 -0
  13. package/dist/react-ui/primitives/DotMatrix/index.d.ts.map +1 -0
  14. package/dist/react-ui/primitives/DotMatrix/index.js +185 -0
  15. package/dist/react-ui/primitives/DotMatrix/patterns.d.ts +32 -0
  16. package/dist/react-ui/primitives/DotMatrix/patterns.d.ts.map +1 -0
  17. package/dist/react-ui/primitives/DotMatrix/patterns.js +175 -0
  18. package/dist/react-ui/primitives/GooeyMorphingSurface/GooeyMorphingSurface.types.d.ts +100 -0
  19. package/dist/react-ui/primitives/GooeyMorphingSurface/GooeyMorphingSurface.types.d.ts.map +1 -0
  20. package/dist/react-ui/primitives/GooeyMorphingSurface/GooeyMorphingSurface.types.js +20 -0
  21. package/dist/react-ui/primitives/GooeyMorphingSurface/gooey-morphing-surface.js +0 -0
  22. package/dist/react-ui/primitives/GooeyMorphingSurface/gooey-morphing.css +112 -0
  23. package/dist/react-ui/primitives/GooeyMorphingSurface/index.d.ts +36 -0
  24. package/dist/react-ui/primitives/GooeyMorphingSurface/index.d.ts.map +1 -0
  25. package/dist/react-ui/primitives/GooeyMorphingSurface/index.js +141 -0
  26. package/dist/react-ui/primitives/index.d.ts +2 -0
  27. package/dist/react-ui/primitives/index.d.ts.map +1 -1
  28. package/dist/react-ui/primitives/index.js +4 -0
  29. package/dist/react-ui/ui/Badge/Badge.styles.d.ts +1 -1
  30. package/dist/react-ui/ui/Button/Button.styles.d.ts +1 -1
  31. package/dist/react-ui/ui/DataCard/DataCard.styles.d.ts +1 -1
  32. package/dist/react-ui/ui/FileIcon/FileIcon.styles.d.ts +25 -0
  33. package/dist/react-ui/ui/FileIcon/FileIcon.styles.d.ts.map +1 -0
  34. package/dist/react-ui/ui/FileIcon/FileIcon.styles.js +31 -0
  35. package/dist/react-ui/ui/FileIcon/FileIcon.types.d.ts +89 -0
  36. package/dist/react-ui/ui/FileIcon/FileIcon.types.d.ts.map +1 -0
  37. package/dist/react-ui/ui/FileIcon/index.d.ts +46 -0
  38. package/dist/react-ui/ui/FileIcon/index.d.ts.map +1 -0
  39. package/dist/react-ui/ui/FileIcon/index.js +138 -0
  40. package/dist/react-ui/ui/FileItem/FileItem.styles.d.ts +47 -0
  41. package/dist/react-ui/ui/FileItem/FileItem.styles.d.ts.map +1 -0
  42. package/dist/react-ui/ui/FileItem/FileItem.styles.js +60 -0
  43. package/dist/react-ui/ui/FileItem/FileItem.types.d.ts +84 -0
  44. package/dist/react-ui/ui/FileItem/FileItem.types.d.ts.map +1 -0
  45. package/dist/react-ui/ui/FileItem/index.d.ts +48 -0
  46. package/dist/react-ui/ui/FileItem/index.d.ts.map +1 -0
  47. package/dist/react-ui/ui/FileItem/index.js +124 -0
  48. package/dist/react-ui/ui/FilePanel/FilePanel.styles.d.ts +34 -0
  49. package/dist/react-ui/ui/FilePanel/FilePanel.styles.d.ts.map +1 -0
  50. package/dist/react-ui/ui/FilePanel/FilePanel.styles.js +57 -0
  51. package/dist/react-ui/ui/FilePanel/FilePanel.types.d.ts +55 -0
  52. package/dist/react-ui/ui/FilePanel/FilePanel.types.d.ts.map +1 -0
  53. package/dist/react-ui/ui/FilePanel/index.d.ts +55 -0
  54. package/dist/react-ui/ui/FilePanel/index.d.ts.map +1 -0
  55. package/dist/react-ui/ui/FilePanel/index.js +107 -0
  56. package/dist/react-ui/ui/FileTree/FileTree.styles.d.ts +31 -0
  57. package/dist/react-ui/ui/FileTree/FileTree.styles.d.ts.map +1 -0
  58. package/dist/react-ui/ui/FileTree/FileTree.styles.js +45 -0
  59. package/dist/react-ui/ui/FileTree/FileTree.types.d.ts +95 -0
  60. package/dist/react-ui/ui/FileTree/FileTree.types.d.ts.map +1 -0
  61. package/dist/react-ui/ui/FileTree/index.d.ts +60 -0
  62. package/dist/react-ui/ui/FileTree/index.d.ts.map +1 -0
  63. package/dist/react-ui/ui/FileTree/index.js +226 -0
  64. package/dist/react-ui/ui/GooeyButton/GooeyButton.types.d.ts +35 -0
  65. package/dist/react-ui/ui/GooeyButton/GooeyButton.types.d.ts.map +1 -0
  66. package/dist/react-ui/ui/GooeyButton/gooey-button.js +0 -0
  67. package/dist/react-ui/ui/GooeyButton/gooey.css +43 -0
  68. package/dist/react-ui/ui/GooeyButton/index.d.ts +26 -0
  69. package/dist/react-ui/ui/GooeyButton/index.d.ts.map +1 -0
  70. package/dist/react-ui/ui/GooeyButton/index.js +109 -0
  71. package/dist/react-ui/ui/MiddleTruncatePath/MiddleTruncatePath.styles.d.ts +23 -0
  72. package/dist/react-ui/ui/MiddleTruncatePath/MiddleTruncatePath.styles.d.ts.map +1 -0
  73. package/dist/react-ui/ui/MiddleTruncatePath/MiddleTruncatePath.styles.js +32 -0
  74. package/dist/react-ui/ui/MiddleTruncatePath/MiddleTruncatePath.types.d.ts +43 -0
  75. package/dist/react-ui/ui/MiddleTruncatePath/MiddleTruncatePath.types.d.ts.map +1 -0
  76. package/dist/react-ui/ui/MiddleTruncatePath/index.d.ts +33 -0
  77. package/dist/react-ui/ui/MiddleTruncatePath/index.d.ts.map +1 -0
  78. package/dist/react-ui/ui/MiddleTruncatePath/index.js +60 -0
  79. package/dist/react-ui/ui/OperationCard/OperationCard.context.d.ts +17 -0
  80. package/dist/react-ui/ui/OperationCard/OperationCard.context.d.ts.map +1 -0
  81. package/dist/react-ui/ui/OperationCard/OperationCard.context.js +27 -0
  82. package/dist/react-ui/ui/OperationCard/OperationCard.styles.d.ts +19 -0
  83. package/dist/react-ui/ui/OperationCard/OperationCard.styles.d.ts.map +1 -0
  84. package/dist/react-ui/ui/OperationCard/OperationCard.styles.js +39 -0
  85. package/dist/react-ui/ui/OperationCard/OperationCard.types.d.ts +188 -0
  86. package/dist/react-ui/ui/OperationCard/OperationCard.types.d.ts.map +1 -0
  87. package/dist/react-ui/ui/OperationCard/index.d.ts +45 -0
  88. package/dist/react-ui/ui/OperationCard/index.d.ts.map +1 -0
  89. package/dist/react-ui/ui/OperationCard/index.js +118 -0
  90. package/dist/react-ui/ui/OperationCard/parts/OperationCardActions.d.ts +3 -0
  91. package/dist/react-ui/ui/OperationCard/parts/OperationCardActions.d.ts.map +1 -0
  92. package/dist/react-ui/ui/OperationCard/parts/OperationCardActions.js +86 -0
  93. package/dist/react-ui/ui/OperationCard/parts/OperationCardHeader.d.ts +14 -0
  94. package/dist/react-ui/ui/OperationCard/parts/OperationCardHeader.d.ts.map +1 -0
  95. package/dist/react-ui/ui/OperationCard/parts/OperationCardHeader.js +62 -0
  96. package/dist/react-ui/ui/OperationCard/parts/OperationCardProgress.d.ts +3 -0
  97. package/dist/react-ui/ui/OperationCard/parts/OperationCardProgress.d.ts.map +1 -0
  98. package/dist/react-ui/ui/OperationCard/parts/OperationCardProgress.js +37 -0
  99. package/dist/react-ui/ui/OperationCard/parts/OperationCardStats.d.ts +3 -0
  100. package/dist/react-ui/ui/OperationCard/parts/OperationCardStats.d.ts.map +1 -0
  101. package/dist/react-ui/ui/OperationCard/parts/OperationCardStats.js +42 -0
  102. package/dist/react-ui/ui/OperationCard/parts/OperationCardVisualizer.d.ts +3 -0
  103. package/dist/react-ui/ui/OperationCard/parts/OperationCardVisualizer.d.ts.map +1 -0
  104. package/dist/react-ui/ui/OperationCard/parts/OperationCardVisualizer.js +53 -0
  105. package/dist/react-ui/ui/Tabs/Tabs.styles.d.ts +3 -3
  106. package/dist/react-ui/ui/index.d.ts +7 -0
  107. package/dist/react-ui/ui/index.d.ts.map +1 -1
  108. package/dist/react-ui/ui/index.js +19 -0
  109. package/package.json +1 -1
@@ -8,7 +8,7 @@ declare const buttonStyles: StyleSlots<ButtonSlot>;
8
8
  * @see {@link https://cva.style/docs/getting-started/variants}
9
9
  */
10
10
  declare const buttonVariants: (props?: ({
11
- variant?: "link" | "default" | "outline" | "ghost" | "secondary" | "destructive" | "success" | "warning" | "bare" | null | undefined;
11
+ variant?: "link" | "default" | "outline" | "success" | "destructive" | "warning" | "ghost" | "secondary" | "bare" | null | undefined;
12
12
  size?: "default" | "icon" | "sm" | "lg" | "bare" | null | undefined;
13
13
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
14
14
  /** State-specific style classes for Button. */
@@ -33,7 +33,7 @@ export declare const dataCardStyles: StyleSlots<DataCardSlot>;
33
33
  */
34
34
  export declare const dataCardVariants: (props?: ({
35
35
  size?: "default" | "compact" | "spacious" | null | undefined;
36
- variant?: "default" | "destructive" | "success" | "warning" | "accent" | null | undefined;
36
+ variant?: "default" | "success" | "destructive" | "warning" | "accent" | null | undefined;
37
37
  glass?: boolean | null | undefined;
38
38
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
39
39
  /**
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Styles for FileIcon / FolderIcon components.
3
+ *
4
+ * @module @mks2508/mks-ui/react/ui/FileIcon
5
+ */
6
+ import type { StyleSlots } from '../../../core/types';
7
+ /** Visual regions for the FileIcon component. */
8
+ export type FileIconSlot = 'root';
9
+ /**
10
+ * Default Tailwind classes for each FileIcon slot.
11
+ *
12
+ * | Slot | Region |
13
+ * |------|--------|
14
+ * | `root` | The `<img>` (or fallback glyph) element |
15
+ */
16
+ export declare const FileIconStyles: StyleSlots<FileIconSlot>;
17
+ /** CVA variants for the FileIcon root. */
18
+ export declare const fileIconVariants: (props?: ({} & import("class-variance-authority/types").ClassProp) | undefined) => string;
19
+ /** Visual regions for the FolderIcon component. */
20
+ export type FolderIconSlot = 'root';
21
+ /** Default Tailwind classes for each FolderIcon slot. */
22
+ export declare const FolderIconStyles: StyleSlots<FolderIconSlot>;
23
+ /** CVA variants for the FolderIcon root. */
24
+ export declare const folderIconVariants: (props?: ({} & import("class-variance-authority/types").ClassProp) | undefined) => string;
25
+ //# sourceMappingURL=FileIcon.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileIcon.styles.d.ts","sourceRoot":"","sources":["../../../../src/react-ui/ui/FileIcon/FileIcon.styles.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,iDAAiD;AACjD,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAElC;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,EAAE,UAAU,CAAC,YAAY,CAE1C,CAAC;AAEX,0CAA0C;AAC1C,eAAO,MAAM,gBAAgB,2FAG3B,CAAC;AAEH,mDAAmD;AACnD,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC;AAEpC,yDAAyD;AACzD,eAAO,MAAM,gBAAgB,EAAE,UAAU,CAAC,cAAc,CAE9C,CAAC;AAEX,4CAA4C;AAC5C,eAAO,MAAM,kBAAkB,2FAG7B,CAAC"}
@@ -0,0 +1,31 @@
1
+ import { cva } from "class-variance-authority";
2
+
3
+ //#region src/react-ui/ui/FileIcon/FileIcon.styles.ts
4
+ /**
5
+ * Styles for FileIcon / FolderIcon components.
6
+ *
7
+ * @module @mks2508/mks-ui/react/ui/FileIcon
8
+ */
9
+ /**
10
+ * Default Tailwind classes for each FileIcon slot.
11
+ *
12
+ * | Slot | Region |
13
+ * |------|--------|
14
+ * | `root` | The `<img>` (or fallback glyph) element |
15
+ */
16
+ const FileIconStyles = { root: "shrink-0" };
17
+ /** CVA variants for the FileIcon root. */
18
+ const fileIconVariants = cva(FileIconStyles.root, {
19
+ variants: {},
20
+ defaultVariants: {}
21
+ });
22
+ /** Default Tailwind classes for each FolderIcon slot. */
23
+ const FolderIconStyles = { root: "shrink-0" };
24
+ /** CVA variants for the FolderIcon root. */
25
+ const folderIconVariants = cva(FolderIconStyles.root, {
26
+ variants: {},
27
+ defaultVariants: {}
28
+ });
29
+
30
+ //#endregion
31
+ export { FileIconStyles, FolderIconStyles, fileIconVariants, folderIconVariants };
@@ -0,0 +1,89 @@
1
+ /**
2
+ * Types for FileIcon / FolderIcon components.
3
+ *
4
+ * @module @mks2508/mks-ui/react/ui/FileIcon
5
+ */
6
+ import type { SlotOverrides } from '../../../core/types';
7
+ import type { FileIconSlot, FolderIconSlot } from './FileIcon.styles';
8
+ /**
9
+ * Function that resolves a filename to an icon asset identifier.
10
+ *
11
+ * Return value is the filename of the SVG (e.g. `"typescript.svg"`)
12
+ * which is appended to `basePath` to form the full URL.
13
+ *
14
+ * Defaults (when `vscode-material-icon-theme-js` is available as an
15
+ * optional peer) use the Material Icon Theme resolver. Consumers may
16
+ * pass their own to support custom icon sets.
17
+ */
18
+ export type FileIconResolver = (filename: string) => string;
19
+ /**
20
+ * Function that resolves a folder name (and open state) to an icon asset.
21
+ */
22
+ export type FolderIconResolver = (name: string, open: boolean) => string;
23
+ /**
24
+ * Props for FileIcon.
25
+ *
26
+ * @see {@link FileIconSlot} for available slot names
27
+ */
28
+ export interface IFileIconProps {
29
+ /** Filename (e.g. `"App.tsx"`, `"package.json"`, `".gitignore"`). */
30
+ filename: string;
31
+ /** Icon size in pixels. Default 16. */
32
+ size?: number;
33
+ /** Optional CSS class merged onto the root. */
34
+ className?: string;
35
+ /** Whether this entry is a submodule (renders a GitFork glyph). */
36
+ isSubmodule?: boolean;
37
+ /**
38
+ * Base path prefix where icon SVGs are hosted. Default `"/file-icons/"`.
39
+ * Consumers must serve the matching SVGs (same contract as Material Icon Theme).
40
+ */
41
+ basePath?: string;
42
+ /**
43
+ * Custom resolver to translate filename → SVG basename.
44
+ * Falls back to Material Icon Theme resolver if available at runtime.
45
+ */
46
+ resolve?: FileIconResolver;
47
+ /**
48
+ * Override default Tailwind classes for specific visual regions.
49
+ *
50
+ * @example
51
+ * ```tsx
52
+ * <FileIcon filename="App.tsx" slots={{ root: 'opacity-80' }} />
53
+ * ```
54
+ */
55
+ slots?: SlotOverrides<FileIconSlot>;
56
+ }
57
+ /**
58
+ * Props for FolderIcon.
59
+ *
60
+ * @see {@link FolderIconSlot} for available slot names
61
+ */
62
+ export interface IFolderIconProps {
63
+ /** Folder name (e.g. `"src"`, `"components"`, `"node_modules"`). */
64
+ name: string;
65
+ /** Whether the folder is open/expanded. Default false. */
66
+ open?: boolean;
67
+ /** Icon size in pixels. Default 16. */
68
+ size?: number;
69
+ /** Optional CSS class merged onto the root. */
70
+ className?: string;
71
+ /**
72
+ * Base path prefix where icon SVGs are hosted. Default `"/file-icons/"`.
73
+ */
74
+ basePath?: string;
75
+ /**
76
+ * Custom resolver (closed + open). Falls back to Material Icon Theme if available.
77
+ */
78
+ resolve?: FolderIconResolver;
79
+ /**
80
+ * Override default Tailwind classes for specific visual regions.
81
+ *
82
+ * @example
83
+ * ```tsx
84
+ * <FolderIcon name="src" slots={{ root: 'opacity-80' }} />
85
+ * ```
86
+ */
87
+ slots?: SlotOverrides<FolderIconSlot>;
88
+ }
89
+ //# sourceMappingURL=FileIcon.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileIcon.types.d.ts","sourceRoot":"","sources":["../../../../src/react-ui/ui/FileIcon/FileIcon.types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEtE;;;;;;;;;GASG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC;AAE5D;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,KAAK,MAAM,CAAC;AAEzE;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,qEAAqE;IACrE,QAAQ,EAAE,MAAM,CAAC;IACjB,uCAAuC;IACvC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+CAA+C;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mEAAmE;IACnE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;CACrC;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,oEAAoE;IACpE,IAAI,EAAE,MAAM,CAAC;IACb,0DAA0D;IAC1D,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,uCAAuC;IACvC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+CAA+C;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;CACvC"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * FileIcon / FolderIcon — Material Icon Theme-powered file/folder glyphs.
3
+ *
4
+ * Thin React wrapper over a configurable icon resolver. By default it
5
+ * consumes `vscode-material-icon-theme-js` (optional peer) to map a
6
+ * filename to an SVG basename, then renders an `<img>` pointing at
7
+ * `${basePath}${basename}`. Consumers are responsible for hosting the
8
+ * SVGs under `basePath` (defaults to `/file-icons/`).
9
+ *
10
+ * Ported from mks-mission-control with MC-specific plumbing stripped.
11
+ *
12
+ * @module @mks2508/mks-ui/react/ui/FileIcon
13
+ */
14
+ import type { IFileIconProps, IFolderIconProps } from './FileIcon.types';
15
+ /**
16
+ * FileIcon — renders an icon for a given filename.
17
+ *
18
+ * @param filename - Filename used to resolve the icon asset
19
+ * @param slots - Override Tailwind classes per visual slot
20
+ *
21
+ * @example
22
+ * ```tsx
23
+ * <FileIcon filename="App.tsx" /> // react_ts.svg
24
+ * <FileIcon filename="package.json" /> // json.svg
25
+ * <FileIcon filename=".gitignore" size={20} />
26
+ * ```
27
+ */
28
+ export declare const FileIcon: import("react").MemoExoticComponent<({ filename, size, className, isSubmodule, basePath, resolve, slots, }: IFileIconProps) => import("react/jsx-runtime").JSX.Element>;
29
+ /**
30
+ * FolderIcon — renders an icon for a given folder (supports open/closed state).
31
+ *
32
+ * @param name - Folder name used to resolve the icon asset
33
+ * @param open - Whether the folder is visually open
34
+ * @param slots - Override Tailwind classes per visual slot
35
+ *
36
+ * @example
37
+ * ```tsx
38
+ * <FolderIcon name="src" /> // folder-src.svg
39
+ * <FolderIcon name="src" open /> // folder-src-open.svg
40
+ * ```
41
+ */
42
+ export declare const FolderIcon: import("react").MemoExoticComponent<({ name, open, size, className, basePath, resolve, slots, }: IFolderIconProps) => import("react/jsx-runtime").JSX.Element>;
43
+ export { FileIconStyles, fileIconVariants, FolderIconStyles, folderIconVariants, } from './FileIcon.styles';
44
+ export type { FileIconSlot, FolderIconSlot } from './FileIcon.styles';
45
+ export type { IFileIconProps, IFolderIconProps, FileIconResolver, FolderIconResolver, } from './FileIcon.types';
46
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/react-ui/ui/FileIcon/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAYH,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB,EAGjB,MAAM,kBAAkB,CAAC;AAwE1B;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,QAAQ,8GAQlB,cAAc,6CAuBf,CAAC;AAEH;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,UAAU,mGAQpB,gBAAgB,6CAajB,CAAC;AAEH,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACtE,YAAY,EACV,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,138 @@
1
+ 'use client';
2
+
3
+ import { cn } from "../../lib/utils.js";
4
+ import { FileIconStyles, FolderIconStyles, fileIconVariants, folderIconVariants } from "./FileIcon.styles.js";
5
+ import { memo } from "react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+
8
+ //#region src/react-ui/ui/FileIcon/index.tsx
9
+ /**
10
+ * FileIcon / FolderIcon — Material Icon Theme-powered file/folder glyphs.
11
+ *
12
+ * Thin React wrapper over a configurable icon resolver. By default it
13
+ * consumes `vscode-material-icon-theme-js` (optional peer) to map a
14
+ * filename to an SVG basename, then renders an `<img>` pointing at
15
+ * `${basePath}${basename}`. Consumers are responsible for hosting the
16
+ * SVGs under `basePath` (defaults to `/file-icons/`).
17
+ *
18
+ * Ported from mks-mission-control with MC-specific plumbing stripped.
19
+ *
20
+ * @module @mks2508/mks-ui/react/ui/FileIcon
21
+ */
22
+ /**
23
+ * Try to load the Material Icon Theme resolver lazily.
24
+ *
25
+ * Uses a runtime require via dynamic lookup so that consumers who do
26
+ * not install `vscode-material-icon-theme-js` simply get a `file.svg`
27
+ * fallback instead of a bundler error.
28
+ */
29
+ function tryLoadMaterialResolvers() {
30
+ try {
31
+ const mod = globalThis.require?.("vscode-material-icon-theme-js");
32
+ if (!mod) return {};
33
+ return {
34
+ file: mod.getIconForFile,
35
+ folder: mod.getIconForFolder,
36
+ folderOpen: mod.getIconForOpenFolder
37
+ };
38
+ } catch {
39
+ return {};
40
+ }
41
+ }
42
+ const MATERIAL = /* @__PURE__ */ tryLoadMaterialResolvers();
43
+ /** Default filename → svg-basename resolver. */
44
+ const defaultFileResolver = (filename) => MATERIAL.file?.(filename) ?? "file.svg";
45
+ /** Default foldername → svg-basename resolver. */
46
+ const defaultFolderResolver = (name, open) => {
47
+ if (open) return MATERIAL.folderOpen?.(name) ?? "folder-open.svg";
48
+ return MATERIAL.folder?.(name) ?? "folder.svg";
49
+ };
50
+ /** Minimal inline git-fork glyph used for submodules (no external icon dep). */
51
+ function GitForkGlyph({ size, className }) {
52
+ return /* @__PURE__ */ jsxs("svg", {
53
+ width: size,
54
+ height: size,
55
+ viewBox: "0 0 24 24",
56
+ fill: "none",
57
+ stroke: "currentColor",
58
+ strokeWidth: 1.5,
59
+ strokeLinecap: "round",
60
+ strokeLinejoin: "round",
61
+ className: cn("shrink-0 text-primary", className),
62
+ "aria-hidden": "true",
63
+ children: [
64
+ /* @__PURE__ */ jsx("circle", {
65
+ cx: "12",
66
+ cy: "18",
67
+ r: "3"
68
+ }),
69
+ /* @__PURE__ */ jsx("circle", {
70
+ cx: "6",
71
+ cy: "6",
72
+ r: "3"
73
+ }),
74
+ /* @__PURE__ */ jsx("circle", {
75
+ cx: "18",
76
+ cy: "6",
77
+ r: "3"
78
+ }),
79
+ /* @__PURE__ */ jsx("path", { d: "M18 9v1a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2V9" }),
80
+ /* @__PURE__ */ jsx("path", { d: "M12 12v3" })
81
+ ]
82
+ });
83
+ }
84
+ /**
85
+ * FileIcon — renders an icon for a given filename.
86
+ *
87
+ * @param filename - Filename used to resolve the icon asset
88
+ * @param slots - Override Tailwind classes per visual slot
89
+ *
90
+ * @example
91
+ * ```tsx
92
+ * <FileIcon filename="App.tsx" /> // react_ts.svg
93
+ * <FileIcon filename="package.json" /> // json.svg
94
+ * <FileIcon filename=".gitignore" size={20} />
95
+ * ```
96
+ */
97
+ const FileIcon = memo(function FileIcon({ filename, size = 16, className, isSubmodule, basePath = "/file-icons/", resolve = defaultFileResolver, slots }) {
98
+ if (isSubmodule) return /* @__PURE__ */ jsx(GitForkGlyph, {
99
+ size,
100
+ className: cn(fileIconVariants(), slots?.root, className)
101
+ });
102
+ return /* @__PURE__ */ jsx("img", {
103
+ src: `${basePath}${resolve(filename)}`,
104
+ alt: "",
105
+ width: size,
106
+ height: size,
107
+ className: cn(fileIconVariants(), slots?.root, className),
108
+ loading: "lazy",
109
+ decoding: "async"
110
+ });
111
+ });
112
+ /**
113
+ * FolderIcon — renders an icon for a given folder (supports open/closed state).
114
+ *
115
+ * @param name - Folder name used to resolve the icon asset
116
+ * @param open - Whether the folder is visually open
117
+ * @param slots - Override Tailwind classes per visual slot
118
+ *
119
+ * @example
120
+ * ```tsx
121
+ * <FolderIcon name="src" /> // folder-src.svg
122
+ * <FolderIcon name="src" open /> // folder-src-open.svg
123
+ * ```
124
+ */
125
+ const FolderIcon = memo(function FolderIcon({ name, open = false, size = 16, className, basePath = "/file-icons/", resolve = defaultFolderResolver, slots }) {
126
+ return /* @__PURE__ */ jsx("img", {
127
+ src: `${basePath}${resolve(name, open)}`,
128
+ alt: "",
129
+ width: size,
130
+ height: size,
131
+ className: cn(folderIconVariants(), slots?.root, className),
132
+ loading: "lazy",
133
+ decoding: "async"
134
+ });
135
+ });
136
+
137
+ //#endregion
138
+ export { FileIcon, FolderIcon };
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Styles for FileItem.
3
+ *
4
+ * @module @mks2508/mks-ui/react/ui/FileItem
5
+ */
6
+ import type { StyleSlots } from '../../../core/types';
7
+ /** Visual regions of the FileItem component. */
8
+ export type FileItemSlot = 'root' | 'icon' | 'path' | 'modifiedChip' | 'boost' | 'gitStatus';
9
+ /**
10
+ * Tailwind utility classes per git change status. All values resolve to
11
+ * theme design tokens (CSS variables) so the dot colours adapt across
12
+ * light/dark and custom themes without hardcoded hex.
13
+ *
14
+ * Consumers can override via `slots.gitStatus` when a view needs a
15
+ * different palette (e.g. VSCode-style gutter).
16
+ */
17
+ export declare const FileItemGitStatusClasses: {
18
+ readonly modified: "bg-primary";
19
+ readonly added: "bg-accent-foreground";
20
+ readonly deleted: "bg-destructive";
21
+ readonly untracked: "bg-ring";
22
+ readonly renamed: "bg-secondary-foreground";
23
+ };
24
+ /**
25
+ * Default Tailwind classes for each FileItem slot.
26
+ *
27
+ * | Slot | Region |
28
+ * |------|--------|
29
+ * | `root` | Row container |
30
+ * | `icon` | Leading file/folder icon |
31
+ * | `path` | Middle-truncated path |
32
+ * | `modifiedChip` | Trailing "Xh ago" chip |
33
+ * | `boost` | Trailing boost (⭐) glyph |
34
+ * | `gitStatus` | Leading git change-status dot (only rendered when `changeStatus` is set to a non-null value) |
35
+ */
36
+ export declare const FileItemStyles: StyleSlots<FileItemSlot>;
37
+ /**
38
+ * CVA variants for the FileItem root.
39
+ *
40
+ * Density variants:
41
+ * - `compact` — 28px row (h-7), smaller icon
42
+ * - `comfortable` — 32px row (h-8), default icon size
43
+ */
44
+ export declare const fileItemVariants: (props?: ({
45
+ density?: "compact" | "comfortable" | null | undefined;
46
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
47
+ //# sourceMappingURL=FileItem.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileItem.styles.d.ts","sourceRoot":"","sources":["../../../../src/react-ui/ui/FileItem/FileItem.styles.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,gDAAgD;AAChD,MAAM,MAAM,YAAY,GACpB,MAAM,GACN,MAAM,GACN,MAAM,GACN,cAAc,GACd,OAAO,GACP,WAAW,CAAC;AAEhB;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB;;;;;;CAM3B,CAAC;AAEX;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,cAAc,EAAE,UAAU,CAAC,YAAY,CAO1C,CAAC;AAEX;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB;;8EAU3B,CAAC"}
@@ -0,0 +1,60 @@
1
+ import { cva } from "class-variance-authority";
2
+
3
+ //#region src/react-ui/ui/FileItem/FileItem.styles.ts
4
+ /**
5
+ * Styles for FileItem.
6
+ *
7
+ * @module @mks2508/mks-ui/react/ui/FileItem
8
+ */
9
+ /**
10
+ * Tailwind utility classes per git change status. All values resolve to
11
+ * theme design tokens (CSS variables) so the dot colours adapt across
12
+ * light/dark and custom themes without hardcoded hex.
13
+ *
14
+ * Consumers can override via `slots.gitStatus` when a view needs a
15
+ * different palette (e.g. VSCode-style gutter).
16
+ */
17
+ const FileItemGitStatusClasses = {
18
+ modified: "bg-primary",
19
+ added: "bg-accent-foreground",
20
+ deleted: "bg-destructive",
21
+ untracked: "bg-ring",
22
+ renamed: "bg-secondary-foreground"
23
+ };
24
+ /**
25
+ * Default Tailwind classes for each FileItem slot.
26
+ *
27
+ * | Slot | Region |
28
+ * |------|--------|
29
+ * | `root` | Row container |
30
+ * | `icon` | Leading file/folder icon |
31
+ * | `path` | Middle-truncated path |
32
+ * | `modifiedChip` | Trailing "Xh ago" chip |
33
+ * | `boost` | Trailing boost (⭐) glyph |
34
+ * | `gitStatus` | Leading git change-status dot (only rendered when `changeStatus` is set to a non-null value) |
35
+ */
36
+ const FileItemStyles = {
37
+ root: "file-list-item group flex items-center gap-1.5 px-2 cursor-pointer select-none transition-colors duration-100 hover:bg-accent/40 focus:bg-accent/50 focus:outline-none data-[active]:bg-accent/60",
38
+ icon: "",
39
+ path: "flex-1 min-w-0 text-xs font-mono text-foreground",
40
+ modifiedChip: "shrink-0 text-[10px] font-mono text-muted-foreground/60",
41
+ boost: "shrink-0 text-[11px] text-primary",
42
+ gitStatus: "shrink-0 inline-block size-1.5 rounded-full"
43
+ };
44
+ /**
45
+ * CVA variants for the FileItem root.
46
+ *
47
+ * Density variants:
48
+ * - `compact` — 28px row (h-7), smaller icon
49
+ * - `comfortable` — 32px row (h-8), default icon size
50
+ */
51
+ const fileItemVariants = cva(FileItemStyles.root, {
52
+ variants: { density: {
53
+ compact: "h-7",
54
+ comfortable: "h-8"
55
+ } },
56
+ defaultVariants: { density: "compact" }
57
+ });
58
+
59
+ //#endregion
60
+ export { FileItemGitStatusClasses, FileItemStyles, fileItemVariants };
@@ -0,0 +1,84 @@
1
+ /**
2
+ * Types for FileItem.
3
+ *
4
+ * @module @mks2508/mks-ui/react/ui/FileItem
5
+ */
6
+ import type { VariantProps } from 'class-variance-authority';
7
+ import type { SlotOverrides } from '../../../core/types';
8
+ import type { FileIconResolver } from '../FileIcon/FileIcon.types';
9
+ import type { FileItemSlot, fileItemVariants } from './FileItem.styles';
10
+ /** What kind of filesystem entry this row represents. */
11
+ export type FileItemKind = 'file' | 'dir';
12
+ /**
13
+ * Git change status for a file, rendered as a small dot in the `gitStatus`
14
+ * slot when set. Colours resolve to theme design tokens (see
15
+ * {@link FileItemGitStatusClasses}) so the dot reads correctly under any
16
+ * theme without hardcoded hex.
17
+ *
18
+ * | Status | Token | Meaning |
19
+ * |--------|-------|---------|
20
+ * | `modified` | `bg-primary` | Tracked file with unstaged or staged modifications |
21
+ * | `added` | `bg-accent-foreground` | New file staged |
22
+ * | `deleted` | `bg-destructive` | Tracked file removed from the working tree |
23
+ * | `untracked` | `bg-ring` | New file not yet tracked by git |
24
+ * | `renamed` | `bg-secondary-foreground` | File renamed/moved (porcelain `R`) |
25
+ */
26
+ export type FileItemChangeStatus = 'modified' | 'added' | 'deleted' | 'untracked' | 'renamed';
27
+ /**
28
+ * Visual density of the row.
29
+ *
30
+ * Maps 1:1 to the `density` CVA variant in `fileItemVariants`.
31
+ */
32
+ export type FileItemDensity = NonNullable<VariantProps<typeof fileItemVariants>['density']>;
33
+ /**
34
+ * Props for FileItem.
35
+ *
36
+ * @see {@link FileItemSlot} for available slot names
37
+ */
38
+ export interface IFileItemProps extends Omit<VariantProps<typeof fileItemVariants>, 'density'> {
39
+ /** Full path relative to some root (e.g. `"src/components/Button/index.tsx"`). */
40
+ path: string;
41
+ /** Whether this is a file or a directory. */
42
+ kind: FileItemKind;
43
+ /** Last-modified timestamp; when present renders a "Xh ago"-style chip. */
44
+ modifiedAt?: Date;
45
+ /** Mark this row with a boost glyph (e.g. ⭐ recents/pinned). */
46
+ isBoosted?: boolean;
47
+ /**
48
+ * Git change status — when set to a non-null value, renders a small
49
+ * coloured dot in the `gitStatus` slot before the path. Accepts `null`
50
+ * explicitly so consumers that receive optional data from a backend
51
+ * (e.g. `?withGitStatus=true`) can pass through cleanly.
52
+ */
53
+ changeStatus?: FileItemChangeStatus | null;
54
+ /** Whether this row is currently selected (for highlighting). */
55
+ selected?: boolean;
56
+ /** Click / activate handler. */
57
+ onSelect?: () => void;
58
+ /** Row density. Default `"compact"` (28px, matches MC). */
59
+ density?: FileItemDensity;
60
+ /**
61
+ * Icon base path passed to FileIcon. Default `"/file-icons/"`.
62
+ */
63
+ iconBasePath?: string;
64
+ /** Custom file-icon resolver. */
65
+ iconResolve?: FileIconResolver;
66
+ /** Optional CSS class merged onto the root. */
67
+ className?: string;
68
+ /** Native tab index. Default 0 so rows are keyboard-reachable. */
69
+ tabIndex?: number;
70
+ /**
71
+ * Override default Tailwind classes for specific visual regions.
72
+ *
73
+ * @example
74
+ * ```tsx
75
+ * <FileItem
76
+ * path="src/App.tsx"
77
+ * kind="file"
78
+ * slots={{ root: 'rounded-md', boost: 'text-warning' }}
79
+ * />
80
+ * ```
81
+ */
82
+ slots?: SlotOverrides<FileItemSlot>;
83
+ }
84
+ //# sourceMappingURL=FileItem.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileItem.types.d.ts","sourceRoot":"","sources":["../../../../src/react-ui/ui/FileItem/FileItem.types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAExE,yDAAyD;AACzD,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,KAAK,CAAC;AAE1C;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,oBAAoB,GAC5B,UAAU,GACV,OAAO,GACP,SAAS,GACT,WAAW,GACX,SAAS,CAAC;AAEd;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,WAAW,CACvC,YAAY,CAAC,OAAO,gBAAgB,CAAC,CAAC,SAAS,CAAC,CACjD,CAAC;AAEF;;;;GAIG;AACH,MAAM,WAAW,cACf,SAAQ,IAAI,CAAC,YAAY,CAAC,OAAO,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAC9D,kFAAkF;IAClF,IAAI,EAAE,MAAM,CAAC;IACb,6CAA6C;IAC7C,IAAI,EAAE,YAAY,CAAC;IACnB,2EAA2E;IAC3E,UAAU,CAAC,EAAE,IAAI,CAAC;IAClB,gEAAgE;IAChE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAC3C,iEAAiE;IACjE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,2DAA2D;IAC3D,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iCAAiC;IACjC,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,+CAA+C;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kEAAkE;IAClE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;CACrC"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * FileItem — compact file-row primitive (icon + path + modified-chip + boost).
3
+ *
4
+ * Trimmed port of `mks-mission-control`'s FileItem: git-status dots,
5
+ * staging, discard flow, context menu and multi-select were all stripped.
6
+ * This is the row shape expected by mention menus, file pickers and
7
+ * simple file lists.
8
+ *
9
+ * Layout (compact, 28px row):
10
+ * [icon] [path — middle truncated] [modified-chip?] [⭐?]
11
+ *
12
+ * Keyboard: `role="option"`, `tabIndex=0`, Enter/Space fires `onSelect`.
13
+ *
14
+ * @module @mks2508/mks-ui/react/ui/FileItem
15
+ */
16
+ import type { IFileItemProps } from './FileItem.types';
17
+ /**
18
+ * FileItem — single row rendering an icon, path, optional modified chip and boost star.
19
+ *
20
+ * @param density - Row density (`compact` 28px vs `comfortable` 32px)
21
+ * @param slots - Override Tailwind classes per visual slot
22
+ *
23
+ * @example
24
+ * ```tsx
25
+ * <FileItem
26
+ * path="src/components/Button/index.tsx"
27
+ * kind="file"
28
+ * modifiedAt={new Date()}
29
+ * isBoosted
30
+ * onSelect={() => console.log('picked')}
31
+ * />
32
+ * ```
33
+ *
34
+ * @example
35
+ * ```tsx
36
+ * // With slot overrides
37
+ * <FileItem
38
+ * path="src/App.tsx"
39
+ * kind="file"
40
+ * slots={{ root: 'rounded-md', boost: 'text-destructive' }}
41
+ * />
42
+ * ```
43
+ */
44
+ export declare const FileItem: import("react").MemoExoticComponent<({ path, kind, modifiedAt, isBoosted, changeStatus, selected, onSelect, density, iconBasePath, iconResolve, className, tabIndex, slots, }: IFileItemProps) => import("react/jsx-runtime").JSX.Element>;
45
+ export { FileItemGitStatusClasses, FileItemStyles, fileItemVariants, } from './FileItem.styles';
46
+ export type { FileItemSlot } from './FileItem.styles';
47
+ export type { IFileItemProps, FileItemKind, FileItemDensity, FileItemChangeStatus, } from './FileItem.types';
48
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/react-ui/ui/FileItem/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAaH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAkBvD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,QAAQ,iLAclB,cAAc,6CA6Ef,CAAC;AAEH,OAAO,EACL,wBAAwB,EACxB,cAAc,EACd,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,YAAY,EACV,cAAc,EACd,YAAY,EACZ,eAAe,EACf,oBAAoB,GACrB,MAAM,kBAAkB,CAAC"}