diff --git a/app/forms/image-from-snapshot.tsx b/app/forms/image-from-snapshot.tsx index 072ff7634..8c10dd3eb 100644 --- a/app/forms/image-from-snapshot.tsx +++ b/app/forms/image-from-snapshot.tsx @@ -5,7 +5,7 @@ * * Copyright Oxide Computer Company */ -import fileSize from 'filesize' +import { filesize } from 'filesize' import { useNavigate, type LoaderFunctionArgs } from 'react-router-dom' import { @@ -83,7 +83,7 @@ export function CreateImageFromSnapshotSideModalForm() { {data.name} {project} - {fileSize(data.size, { base: 2 })} + {filesize(data.size, { base: 2 })} diff --git a/app/forms/image-upload.tsx b/app/forms/image-upload.tsx index 05eaf5532..fdcc62cb2 100644 --- a/app/forms/image-upload.tsx +++ b/app/forms/image-upload.tsx @@ -6,7 +6,7 @@ * Copyright Oxide Computer Company */ import cn from 'classnames' -import filesize from 'filesize' +import { filesize } from 'filesize' import pMap from 'p-map' import pRetry from 'p-retry' import { useRef, useState } from 'react' diff --git a/app/pages/project/instances/instance/InstancePage.tsx b/app/pages/project/instances/instance/InstancePage.tsx index 9b5a8b22c..0debbf1b2 100644 --- a/app/pages/project/instances/instance/InstancePage.tsx +++ b/app/pages/project/instances/instance/InstancePage.tsx @@ -6,7 +6,7 @@ * Copyright Oxide Computer Company */ import { format } from 'date-fns' -import filesize from 'filesize' +import { filesize } from 'filesize' import { useMemo } from 'react' import { Link, useNavigate, type LoaderFunctionArgs } from 'react-router-dom' diff --git a/app/pages/system/inventory/sled/SledPage.tsx b/app/pages/system/inventory/sled/SledPage.tsx index 1f18cf7c2..ed055b508 100644 --- a/app/pages/system/inventory/sled/SledPage.tsx +++ b/app/pages/system/inventory/sled/SledPage.tsx @@ -5,7 +5,7 @@ * * Copyright Oxide Computer Company */ -import fileSize from 'filesize' +import { filesize } from 'filesize' import type { LoaderFunctionArgs } from 'react-router-dom' import { apiQueryClient, usePrefetchedApiQuery } from '@oxide/api' @@ -27,7 +27,7 @@ export function SledPage() { const { sledId } = useSledParams() const { data: sled } = usePrefetchedApiQuery('sledView', { path: { sledId } }) - const ram = fileSize(sled.usablePhysicalRam, { output: 'object', base: 2 }) + const ram = filesize(sled.usablePhysicalRam, { output: 'object', base: 2 }) return ( <> diff --git a/libs/table/cells/InstanceResourceCell.tsx b/libs/table/cells/InstanceResourceCell.tsx index f568c1bb4..932a6250e 100644 --- a/libs/table/cells/InstanceResourceCell.tsx +++ b/libs/table/cells/InstanceResourceCell.tsx @@ -5,7 +5,7 @@ * * Copyright Oxide Computer Company */ -import fileSize from 'filesize' +import { filesize } from 'filesize' import type { Instance } from '@oxide/api' @@ -14,7 +14,7 @@ import type { Cell } from './Cell' export const InstanceResourceCell = ({ value, }: Cell>) => { - const memory = fileSize(value.memory, { output: 'object', base: 2 }) + const memory = filesize(value.memory, { output: 'object', base: 2 }) return (
diff --git a/libs/table/cells/SizeCell.tsx b/libs/table/cells/SizeCell.tsx index 223482c25..f1f358203 100644 --- a/libs/table/cells/SizeCell.tsx +++ b/libs/table/cells/SizeCell.tsx @@ -5,13 +5,13 @@ * * Copyright Oxide Computer Company */ -import fileSize from 'filesize' +import { filesize } from 'filesize' import type { Cell } from './Cell' /** Human-readable format for size in bytes */ export const SizeCell = ({ value: bytes }: Cell) => { - const size = fileSize(bytes, { base: 2, output: 'object' }) + const size = filesize(bytes, { base: 2, output: 'object' }) return ( {size.value} {size.unit} diff --git a/libs/ui/lib/file-input/FileInput.tsx b/libs/ui/lib/file-input/FileInput.tsx index 3c188b44c..bc0e92497 100644 --- a/libs/ui/lib/file-input/FileInput.tsx +++ b/libs/ui/lib/file-input/FileInput.tsx @@ -6,7 +6,7 @@ * Copyright Oxide Computer Company */ import cn from 'classnames' -import filesize from 'filesize' +import { filesize } from 'filesize' import { forwardRef, useRef, diff --git a/package-lock.json b/package-lock.json index 659741cc7..acdb6b0d0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,7 +25,7 @@ "@tanstack/react-table": "^8.11.3", "classnames": "^2.5.1", "date-fns": "^2.30.0", - "filesize": "^8.0.7", + "filesize": "^10.1.0", "lodash.throttle": "^4.1.1", "match-sorter": "^6.3.1", "mousetrap": "^1.6.5", @@ -10431,11 +10431,11 @@ } }, "node_modules/filesize": { - "version": "8.0.7", - "resolved": "https://registry.npmjs.org/filesize/-/filesize-8.0.7.tgz", - "integrity": "sha512-pjmC+bkIF8XI7fWaH8KxHcZL3DPybs1roSKP4rKDvy20tAWwIObE4+JIseG2byfGKhud5ZnM4YSGKBz7Sh0ndQ==", + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/filesize/-/filesize-10.1.0.tgz", + "integrity": "sha512-GTLKYyBSDz3nPhlLVPjPWZCnhkd9TrrRArNcy8Z+J2cqScB7h2McAzR6NBX6nYOoWafql0roY8hrocxnZBv9CQ==", "engines": { - "node": ">= 0.4.0" + "node": ">= 10.4.0" } }, "node_modules/fill-range": { @@ -29053,9 +29053,9 @@ } }, "filesize": { - "version": "8.0.7", - "resolved": "https://registry.npmjs.org/filesize/-/filesize-8.0.7.tgz", - "integrity": "sha512-pjmC+bkIF8XI7fWaH8KxHcZL3DPybs1roSKP4rKDvy20tAWwIObE4+JIseG2byfGKhud5ZnM4YSGKBz7Sh0ndQ==" + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/filesize/-/filesize-10.1.0.tgz", + "integrity": "sha512-GTLKYyBSDz3nPhlLVPjPWZCnhkd9TrrRArNcy8Z+J2cqScB7h2McAzR6NBX6nYOoWafql0roY8hrocxnZBv9CQ==" }, "fill-range": { "version": "7.0.1", diff --git a/package.json b/package.json index e0c45d27f..39ff3a960 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "@tanstack/react-table": "^8.11.3", "classnames": "^2.5.1", "date-fns": "^2.30.0", - "filesize": "^8.0.7", + "filesize": "^10.1.0", "lodash.throttle": "^4.1.1", "match-sorter": "^6.3.1", "mousetrap": "^1.6.5",