@liiift-studio/mac-os9-ui 0.1.9 → 0.2.2

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/dist/index.cjs CHANGED
@@ -704,7 +704,7 @@ var styles$6 = {"window":"Window-module_window","window--active":"Window-module_
704
704
  * </Window>
705
705
  * ```
706
706
  */
707
- const Window = React.forwardRef(({ children, title, titleBar, active = true, width = 'auto', height = 'auto', className = '', contentClassName = '', showControls = true, onClose, onMinimize, onMaximize, resizable = false, }, ref) => {
707
+ const Window = React.forwardRef(({ children, title, titleBar, active = true, width = 'auto', height = 'auto', className = '', contentClassName = '', showControls = true, onClose, onMinimize, onMaximize, onMouseEnter, resizable = false, }, ref) => {
708
708
  // Class names
709
709
  const windowClassNames = [
710
710
  styles$6.window,
@@ -732,7 +732,7 @@ const Window = React.forwardRef(({ children, title, titleBar, active = true, wid
732
732
  }
733
733
  return null;
734
734
  };
735
- return (jsxRuntime.jsxs("div", { ref: ref, className: windowClassNames, style: windowStyle, children: [renderTitleBar(), jsxRuntime.jsx("div", { className: contentClassNames, children: children }), resizable && jsxRuntime.jsx("div", { className: styles$6.resizeHandle, "aria-hidden": "true" })] }));
735
+ return (jsxRuntime.jsxs("div", { ref: ref, className: windowClassNames, style: windowStyle, onMouseEnter: onMouseEnter, children: [renderTitleBar(), jsxRuntime.jsx("div", { className: contentClassNames, children: children }), resizable && jsxRuntime.jsx("div", { className: styles$6.resizeHandle, "aria-hidden": "true" })] }));
736
736
  });
737
737
  Window.displayName = 'Window';
738
738
 
@@ -1221,10 +1221,11 @@ var styles$1 = {"listView":"ListView-module_listView","header":"ListView-module_
1221
1221
  * ]}
1222
1222
  * selectedIds={['1']}
1223
1223
  * onSelectionChange={(ids) => console.log('Selected:', ids)}
1224
+ * onItemMouseEnter={(item) => console.log('Hovering:', item.name)}
1224
1225
  * />
1225
1226
  * ```
1226
1227
  */
1227
- const ListView = React.forwardRef(({ columns, items, selectedIds = [], onSelectionChange, onItemOpen, onSort, className = '', height = 'auto', }, ref) => {
1228
+ const ListView = React.forwardRef(({ columns, items, selectedIds = [], onSelectionChange, onItemOpen, onItemMouseEnter, onSort, className = '', height = 'auto', }, ref) => {
1228
1229
  const [sortColumn, setSortColumn] = React.useState(null);
1229
1230
  const [sortDirection, setSortDirection] = React.useState('asc');
1230
1231
  // Class names
@@ -1272,6 +1273,12 @@ const ListView = React.forwardRef(({ columns, items, selectedIds = [], onSelecti
1272
1273
  onItemOpen(item);
1273
1274
  }
1274
1275
  }, [onItemOpen]);
1276
+ // Handle row mouse enter
1277
+ const handleRowMouseEnter = React.useCallback((item) => {
1278
+ if (onItemMouseEnter) {
1279
+ onItemMouseEnter(item);
1280
+ }
1281
+ }, [onItemMouseEnter]);
1275
1282
  // Container style
1276
1283
  const containerStyle = {};
1277
1284
  if (height !== 'auto') {
@@ -1283,7 +1290,7 @@ const ListView = React.forwardRef(({ columns, items, selectedIds = [], onSelecti
1283
1290
  : column.width,
1284
1291
  }, onClick: () => handleColumnClick(column.key, column.sortable), children: [column.label, sortColumn === column.key && (jsxRuntime.jsx("span", { className: styles$1.sortIndicator, children: sortDirection === 'asc' ? '▲' : '▼' }))] }, column.key))) }), jsxRuntime.jsx("div", { className: styles$1.body, children: items.map((item) => {
1285
1292
  const isSelected = selectedIds.includes(item.id);
1286
- return (jsxRuntime.jsx("div", { className: `${styles$1.row} ${isSelected ? styles$1.selected : ''}`, onClick: (e) => handleRowClick(item.id, e), onDoubleClick: () => handleRowDoubleClick(item), children: columns.map((column, index) => (jsxRuntime.jsxs("div", { className: styles$1.cell, style: {
1293
+ return (jsxRuntime.jsx("div", { className: `${styles$1.row} ${isSelected ? styles$1.selected : ''}`, onClick: (e) => handleRowClick(item.id, e), onDoubleClick: () => handleRowDoubleClick(item), onMouseEnter: () => handleRowMouseEnter(item), children: columns.map((column, index) => (jsxRuntime.jsxs("div", { className: styles$1.cell, style: {
1287
1294
  width: typeof column.width === 'number'
1288
1295
  ? `${column.width}px`
1289
1296
  : column.width,
@@ -1313,6 +1320,8 @@ var styles = {"folderListContent":"FolderList-module_folderListContent","listVie
1313
1320
  * selectedIds={['1']}
1314
1321
  * onSelectionChange={(ids) => console.log('Selected:', ids)}
1315
1322
  * onItemOpen={(item) => console.log('Open:', item.name)}
1323
+ * onItemMouseEnter={(item) => console.log('Hovering:', item.name)}
1324
+ * onMouseEnter={(e) => console.log('Mouse entered folder list')}
1316
1325
  * />
1317
1326
  * ```
1318
1327
  */
@@ -1320,9 +1329,9 @@ const FolderList = React.forwardRef(({ columns = [
1320
1329
  { key: 'name', label: 'Name', width: '40%' },
1321
1330
  { key: 'modified', label: 'Date Modified', width: '30%' },
1322
1331
  { key: 'size', label: 'Size', width: '30%' },
1323
- ], items, selectedIds, onSelectionChange, onItemOpen, onSort, listHeight = 400, ...windowProps }, ref) => {
1332
+ ], items, selectedIds, onSelectionChange, onItemOpen, onItemMouseEnter, onSort, onMouseEnter, listHeight = 400, ...windowProps }, ref) => {
1324
1333
  // Window content with ListView
1325
- return (jsxRuntime.jsx(Window, { ref: ref, contentClassName: styles.folderListContent, ...windowProps, children: jsxRuntime.jsx(ListView, { columns: columns, items: items, selectedIds: selectedIds, onSelectionChange: onSelectionChange, onItemOpen: onItemOpen, onSort: onSort, height: listHeight, className: styles.listView }) }));
1334
+ return (jsxRuntime.jsx(Window, { ref: ref, contentClassName: styles.folderListContent, onMouseEnter: onMouseEnter, ...windowProps, children: jsxRuntime.jsx(ListView, { columns: columns, items: items, selectedIds: selectedIds, onSelectionChange: onSelectionChange, onItemOpen: onItemOpen, onItemMouseEnter: onItemMouseEnter, onSort: onSort, height: listHeight, className: styles.listView }) }));
1326
1335
  });
1327
1336
  FolderList.displayName = 'FolderList';
1328
1337