@cytario/design 2.4.0 → 3.0.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/dist/index.d.ts +5 -20
- package/dist/index.js +11 -63
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -581,40 +581,25 @@ interface SegmentedControlItemProps extends Omit<ToggleButtonProps$1, "className
|
|
|
581
581
|
}
|
|
582
582
|
declare function SegmentedControlItem({ className, ...props }: SegmentedControlItemProps): react_jsx_runtime.JSX.Element;
|
|
583
583
|
|
|
584
|
-
declare function getFileIcon(type: "directory" | "file", extension?: string): LucideIcon;
|
|
585
|
-
declare function getTypeLabel(type: "directory" | "file", extension?: string): string;
|
|
586
|
-
declare function FileIcon({ type, extension, size, }: {
|
|
587
|
-
type: "directory" | "file";
|
|
588
|
-
extension?: string;
|
|
589
|
-
size?: number;
|
|
590
|
-
}): react_jsx_runtime.JSX.Element;
|
|
591
584
|
interface FileCardProps {
|
|
592
585
|
/** File or folder name */
|
|
593
586
|
name: string;
|
|
594
|
-
/**
|
|
595
|
-
|
|
587
|
+
/** Icon to display in thumbnail fallback and metadata row */
|
|
588
|
+
icon?: LucideIcon;
|
|
596
589
|
/** Human-readable file size (e.g., "12.3 GB") */
|
|
597
590
|
size?: string;
|
|
598
|
-
/** Last modified date/time */
|
|
599
|
-
modified?: string;
|
|
600
|
-
/** File extension (e.g., "ome.tif", "csv") */
|
|
601
|
-
extension?: string;
|
|
602
|
-
/** Whether a thumbnail preview is available */
|
|
603
|
-
hasPreview?: boolean;
|
|
604
591
|
/** Compact mode (smaller card, square aspect, minimal metadata) */
|
|
605
592
|
compact?: boolean;
|
|
606
593
|
/** Custom thumbnail content (e.g., an image preview) */
|
|
607
594
|
children?: React__default.ReactNode;
|
|
608
595
|
/** Info button handler */
|
|
609
596
|
onInfo?: () => void;
|
|
610
|
-
/**
|
|
611
|
-
href?: string;
|
|
612
|
-
/** Handler for click/press interaction (use instead of href for programmatic navigation) */
|
|
597
|
+
/** Handler for click/press interaction */
|
|
613
598
|
onPress?: () => void;
|
|
614
599
|
/** Additional CSS classes */
|
|
615
600
|
className?: string;
|
|
616
601
|
}
|
|
617
|
-
declare function FileCard({ name,
|
|
602
|
+
declare function FileCard({ name, icon: IconComponent, size, compact, children, onInfo, onPress, className, }: FileCardProps): react_jsx_runtime.JSX.Element;
|
|
618
603
|
|
|
619
604
|
interface StorageConnectionCardProps {
|
|
620
605
|
name: string;
|
|
@@ -1037,4 +1022,4 @@ declare const LineHeightTight = 1.25;
|
|
|
1037
1022
|
declare const LineHeightNormal = 1.5;
|
|
1038
1023
|
declare const LineHeightRelaxed = 1.625;
|
|
1039
1024
|
|
|
1040
|
-
export { Badge, type BadgeProps, type BadgeSize, type BadgeVariant, Banner, type BannerProps, type BannerVariant, BorderRadiusFull, BorderRadiusLg, BorderRadiusMd, BorderRadiusNone, BorderRadiusSm, BorderRadiusXl, type BreadcrumbItem, Breadcrumbs, type BreadcrumbsProps, Button, ButtonLink, type ButtonLinkProps, type ButtonProps, type ButtonSize, type ButtonVariant, Card, type CardPadding, type CardProps, Cell, Checkbox, type CheckboxProps, ColorActionDanger, ColorActionDangerHover, ColorActionDefault, ColorActionDefaultHover, ColorActionInfo, ColorActionInfoHover, ColorActionPrimary, ColorActionPrimaryActive, ColorActionPrimaryHover, ColorActionSecondary, ColorActionSecondaryHover, ColorActionSuccess, ColorActionSuccessHover, ColorAmber100, ColorAmber200, ColorAmber300, ColorAmber400, ColorAmber50, ColorAmber500, ColorAmber600, ColorAmber700, ColorAmber800, ColorAmber900, ColorBadgeAmberBg, ColorBadgeAmberText, ColorBadgeGreenBg, ColorBadgeGreenText, ColorBadgeNeutralBg, ColorBadgeNeutralText, ColorBadgePurpleBg, ColorBadgePurpleText, ColorBadgeRoseBg, ColorBadgeRoseText, ColorBadgeSlateBg, ColorBadgeSlateText, ColorBadgeTealBg, ColorBadgeTealText, ColorBannerDangerBg, ColorBannerDangerBorder, ColorBannerDangerIcon, ColorBannerDangerText, ColorBannerInfoBg, ColorBannerInfoBorder, ColorBannerInfoIcon, ColorBannerInfoText, ColorBannerSuccessBg, ColorBannerSuccessBorder, ColorBannerSuccessIcon, ColorBannerSuccessText, ColorBannerWarningBg, ColorBannerWarningBorder, ColorBannerWarningIcon, ColorBannerWarningText, ColorBorderAccent, ColorBorderBrand, ColorBorderDanger, ColorBorderDefault, ColorBorderFocus, ColorBorderInfo, ColorBorderStrong, ColorBorderSuccess, ColorBorderWarning, ColorBrandAccent, ColorBrandPrimary, ColorDeltaDecreaseBg, ColorDeltaDecreaseIcon, ColorDeltaDecreaseText, ColorDeltaFlatBg, ColorDeltaFlatIcon, ColorDeltaFlatText, ColorDeltaIncreaseBg, ColorDeltaIncreaseIcon, ColorDeltaIncreaseText, ColorGreen100, ColorGreen200, ColorGreen300, ColorGreen400, ColorGreen50, ColorGreen500, ColorGreen600, ColorGreen700, ColorGreen800, ColorGreen900, ColorNeutral0, ColorNeutral100, ColorNeutral1000, ColorNeutral200, ColorNeutral300, ColorNeutral400, ColorNeutral50, ColorNeutral500, ColorNeutral600, ColorNeutral700, ColorNeutral800, ColorNeutral900, ColorNeutral950, ColorOverlayBackdrop, ColorProgressFill, ColorProgressFillDanger, ColorProgressFillSuccess, ColorProgressFillWarning, ColorProgressTrack, ColorPurple100, ColorPurple200, ColorPurple300, ColorPurple400, ColorPurple50, ColorPurple500, ColorPurple600, ColorPurple700, ColorPurple800, ColorPurple900, ColorRose100, ColorRose200, ColorRose300, ColorRose400, ColorRose50, ColorRose500, ColorRose600, ColorRose700, ColorRose800, ColorRose900, ColorSlate100, ColorSlate200, ColorSlate300, ColorSlate400, ColorSlate50, ColorSlate500, ColorSlate600, ColorSlate700, ColorSlate800, ColorSlate900, ColorStatusDanger, ColorStatusInfo, ColorStatusSuccess, ColorStatusWarning, ColorSurfaceAccent, ColorSurfaceBrand, ColorSurfaceDanger, ColorSurfaceDefault, ColorSurfaceHover, ColorSurfaceInfo, ColorSurfaceMuted, ColorSurfaceOverlay, ColorSurfacePressed, ColorSurfaceSelected, ColorSurfaceSelectedHover, ColorSurfaceSubtle, ColorSurfaceSuccess, ColorSurfaceWarning, ColorTeal100, ColorTeal200, ColorTeal300, ColorTeal400, ColorTeal50, ColorTeal500, ColorTeal600, ColorTeal700, ColorTeal800, ColorTeal900, ColorTextAccent, ColorTextBrand, ColorTextDanger, ColorTextInfo, ColorTextInverse, ColorTextPrimary, ColorTextSecondary, ColorTextSuccess, ColorTextTertiary, ColorTextWarning, Column, type DataTableProps, type DeltaFormat, DeltaIndicator, type DeltaIndicatorProps, type DeltaMode, Dialog, type DialogProps, EmptyState, type EmptyStateProps, Field, type FieldProps, Fieldset, type FieldsetProps, FileCard, type FileCardProps,
|
|
1025
|
+
export { Badge, type BadgeProps, type BadgeSize, type BadgeVariant, Banner, type BannerProps, type BannerVariant, BorderRadiusFull, BorderRadiusLg, BorderRadiusMd, BorderRadiusNone, BorderRadiusSm, BorderRadiusXl, type BreadcrumbItem, Breadcrumbs, type BreadcrumbsProps, Button, ButtonLink, type ButtonLinkProps, type ButtonProps, type ButtonSize, type ButtonVariant, Card, type CardPadding, type CardProps, Cell, Checkbox, type CheckboxProps, ColorActionDanger, ColorActionDangerHover, ColorActionDefault, ColorActionDefaultHover, ColorActionInfo, ColorActionInfoHover, ColorActionPrimary, ColorActionPrimaryActive, ColorActionPrimaryHover, ColorActionSecondary, ColorActionSecondaryHover, ColorActionSuccess, ColorActionSuccessHover, ColorAmber100, ColorAmber200, ColorAmber300, ColorAmber400, ColorAmber50, ColorAmber500, ColorAmber600, ColorAmber700, ColorAmber800, ColorAmber900, ColorBadgeAmberBg, ColorBadgeAmberText, ColorBadgeGreenBg, ColorBadgeGreenText, ColorBadgeNeutralBg, ColorBadgeNeutralText, ColorBadgePurpleBg, ColorBadgePurpleText, ColorBadgeRoseBg, ColorBadgeRoseText, ColorBadgeSlateBg, ColorBadgeSlateText, ColorBadgeTealBg, ColorBadgeTealText, ColorBannerDangerBg, ColorBannerDangerBorder, ColorBannerDangerIcon, ColorBannerDangerText, ColorBannerInfoBg, ColorBannerInfoBorder, ColorBannerInfoIcon, ColorBannerInfoText, ColorBannerSuccessBg, ColorBannerSuccessBorder, ColorBannerSuccessIcon, ColorBannerSuccessText, ColorBannerWarningBg, ColorBannerWarningBorder, ColorBannerWarningIcon, ColorBannerWarningText, ColorBorderAccent, ColorBorderBrand, ColorBorderDanger, ColorBorderDefault, ColorBorderFocus, ColorBorderInfo, ColorBorderStrong, ColorBorderSuccess, ColorBorderWarning, ColorBrandAccent, ColorBrandPrimary, ColorDeltaDecreaseBg, ColorDeltaDecreaseIcon, ColorDeltaDecreaseText, ColorDeltaFlatBg, ColorDeltaFlatIcon, ColorDeltaFlatText, ColorDeltaIncreaseBg, ColorDeltaIncreaseIcon, ColorDeltaIncreaseText, ColorGreen100, ColorGreen200, ColorGreen300, ColorGreen400, ColorGreen50, ColorGreen500, ColorGreen600, ColorGreen700, ColorGreen800, ColorGreen900, ColorNeutral0, ColorNeutral100, ColorNeutral1000, ColorNeutral200, ColorNeutral300, ColorNeutral400, ColorNeutral50, ColorNeutral500, ColorNeutral600, ColorNeutral700, ColorNeutral800, ColorNeutral900, ColorNeutral950, ColorOverlayBackdrop, ColorProgressFill, ColorProgressFillDanger, ColorProgressFillSuccess, ColorProgressFillWarning, ColorProgressTrack, ColorPurple100, ColorPurple200, ColorPurple300, ColorPurple400, ColorPurple50, ColorPurple500, ColorPurple600, ColorPurple700, ColorPurple800, ColorPurple900, ColorRose100, ColorRose200, ColorRose300, ColorRose400, ColorRose50, ColorRose500, ColorRose600, ColorRose700, ColorRose800, ColorRose900, ColorSlate100, ColorSlate200, ColorSlate300, ColorSlate400, ColorSlate50, ColorSlate500, ColorSlate600, ColorSlate700, ColorSlate800, ColorSlate900, ColorStatusDanger, ColorStatusInfo, ColorStatusSuccess, ColorStatusWarning, ColorSurfaceAccent, ColorSurfaceBrand, ColorSurfaceDanger, ColorSurfaceDefault, ColorSurfaceHover, ColorSurfaceInfo, ColorSurfaceMuted, ColorSurfaceOverlay, ColorSurfacePressed, ColorSurfaceSelected, ColorSurfaceSelectedHover, ColorSurfaceSubtle, ColorSurfaceSuccess, ColorSurfaceWarning, ColorTeal100, ColorTeal200, ColorTeal300, ColorTeal400, ColorTeal50, ColorTeal500, ColorTeal600, ColorTeal700, ColorTeal800, ColorTeal900, ColorTextAccent, ColorTextBrand, ColorTextDanger, ColorTextInfo, ColorTextInverse, ColorTextPrimary, ColorTextSecondary, ColorTextSuccess, ColorTextTertiary, ColorTextWarning, Column, type DataTableProps, type DeltaFormat, DeltaIndicator, type DeltaIndicatorProps, type DeltaMode, Dialog, type DialogProps, EmptyState, type EmptyStateProps, Field, type FieldProps, Fieldset, type FieldsetProps, FileCard, type FileCardProps, FontSize2xl, FontSize3xl, FontSize4xl, FontSize5xl, FontSizeBase, FontSizeLg, FontSizeSm, FontSizeXl, FontSizeXs, FontWeightBold, FontWeightExtrabold, FontWeightLight, FontWeightMedium, FontWeightRegular, FontWeightSemibold, FormWizard, type FormWizardContextValue, FormWizardNav, type FormWizardNavProps, FormWizardProgress, type FormWizardProgressProps, type FormWizardProps, type GroupPosition, H1, H2, H3, Heading, type HeadingLevel, type HeadingProps, type HeadingSize, Icon, IconButton, IconButtonLink, type IconButtonLinkProps, type IconButtonProps, type IconProps, Input, InputAddon, type InputAddonProps, InputGroup, InputGroupContext, type InputGroupProps, type InputProps, Label, type LabelProps, LineHeightNormal, LineHeightRelaxed, LineHeightTight, Link, type LinkProps, type LinkVariant, Menu, MenuCheckboxItem, type MenuCheckboxItemProps, MenuHeader, type MenuHeaderProps, MenuItem, type MenuItemData, type MenuItemProps, type MenuProps, MenuSection, type MenuSectionProps, MenuSeparator, type MenuSeparatorProps, MetricCard, type MetricCardProps, type MetricCardSize, PathPill, type PathPillProps, Pill, type PillColor, type PillProps, Popover, PopoverContent, type PopoverContentProps, type PopoverProps, PopoverTrigger, type PopoverTriggerProps, ProgressBar, type ProgressBarProps, type ProgressBarSize, type ProgressBarVariant, Radio, RadioButton, type RadioButtonProps, RadioGroup, type RadioGroupProps, type RadioProps, Row, SectionHeader, type SectionHeaderProps, SegmentedControl, SegmentedControlItem, type SegmentedControlItemProps, type SegmentedControlProps, type SegmentedControlSelectionMode, type SegmentedControlSize, Select, type SelectItem, type SelectProps, Spacing1, Spacing12, Spacing16, Spacing2, Spacing3, Spacing4, Spacing6, Spacing8, Spinner, type SpinnerProps, StorageConnectionCard, type StorageConnectionCardProps, Switch, type SwitchProps, Tab, TabList, type TabListProps, TabPanel, type TabPanelProps, type TabProps, Table, TableBody, TableHeader, type TableSize, Tabs, type TabsProps, type TabsSize, type TabsVariant, type ToastBridge, type ToastContextValue, type ToastData, type ToastPlacement, ToastProvider, type ToastProviderProps, type ToastVariant, ToggleButton, ToggleButtonGroup, ToggleButtonGroupItem, type ToggleButtonGroupItemProps, type ToggleButtonGroupProps, type ToggleButtonGroupSize, type ToggleButtonProps, type ToggleButtonSize, type ToggleButtonVariant, Tooltip, type TooltipProps, Tree, type TreeNode, type TreeProps, createToastBridge, pillColorFromName, useFormWizard, useInputGroup, useToast };
|
package/dist/index.js
CHANGED
|
@@ -2387,65 +2387,21 @@ function SegmentedControlItem({
|
|
|
2387
2387
|
|
|
2388
2388
|
// src/components/FileCard/FileCard.tsx
|
|
2389
2389
|
import { useCallback as useCallback3 } from "react";
|
|
2390
|
-
import {
|
|
2391
|
-
File as File2,
|
|
2392
|
-
FileSpreadsheet,
|
|
2393
|
-
Folder as Folder2,
|
|
2394
|
-
Image,
|
|
2395
|
-
Info as Info2,
|
|
2396
|
-
Microscope
|
|
2397
|
-
} from "lucide-react";
|
|
2390
|
+
import { File as File2, Info as Info2 } from "lucide-react";
|
|
2398
2391
|
import { Fragment as Fragment9, jsx as jsx37, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2399
|
-
function getFileIcon(type, extension) {
|
|
2400
|
-
if (type === "directory") return Folder2;
|
|
2401
|
-
const ext = (extension ?? "").toLowerCase();
|
|
2402
|
-
if (ext === "ome.tif" || ext === "ome.tiff") return Microscope;
|
|
2403
|
-
if (/^(tiff?|png|jpe?g)$/.test(ext)) return Image;
|
|
2404
|
-
if (/^(csv|parquet)$/.test(ext)) return FileSpreadsheet;
|
|
2405
|
-
return File2;
|
|
2406
|
-
}
|
|
2407
|
-
function getTypeLabel(type, extension) {
|
|
2408
|
-
if (type === "directory") return "Folder";
|
|
2409
|
-
const ext = (extension ?? "").toLowerCase();
|
|
2410
|
-
if (ext === "ome.tif" || ext === "ome.tiff") return "OME-TIFF";
|
|
2411
|
-
if (/^tiff?$/.test(ext)) return "TIFF";
|
|
2412
|
-
if (ext === "csv") return "CSV";
|
|
2413
|
-
if (ext === "parquet") return "Parquet";
|
|
2414
|
-
if (ext === "png") return "PNG";
|
|
2415
|
-
if (/^jpe?g$/.test(ext)) return "JPEG";
|
|
2416
|
-
return ext.toUpperCase() || "File";
|
|
2417
|
-
}
|
|
2418
|
-
function FileIcon({
|
|
2419
|
-
type,
|
|
2420
|
-
extension,
|
|
2421
|
-
size = 16
|
|
2422
|
-
}) {
|
|
2423
|
-
const IconComponent = getFileIcon(type, extension);
|
|
2424
|
-
return /* @__PURE__ */ jsx37(
|
|
2425
|
-
IconComponent,
|
|
2426
|
-
{
|
|
2427
|
-
size,
|
|
2428
|
-
className: "shrink-0 text-(--color-text-secondary)"
|
|
2429
|
-
}
|
|
2430
|
-
);
|
|
2431
|
-
}
|
|
2432
2392
|
function FileCard({
|
|
2433
2393
|
name,
|
|
2434
|
-
|
|
2394
|
+
icon: IconComponent = File2,
|
|
2435
2395
|
size,
|
|
2436
|
-
extension,
|
|
2437
2396
|
compact = false,
|
|
2438
2397
|
children,
|
|
2439
2398
|
onInfo,
|
|
2440
|
-
href,
|
|
2441
2399
|
onPress,
|
|
2442
2400
|
className
|
|
2443
2401
|
}) {
|
|
2444
|
-
const isInteractive = !!
|
|
2402
|
+
const isInteractive = !!onPress;
|
|
2445
2403
|
const radius = compact ? "rounded-md" : "rounded-lg";
|
|
2446
|
-
const IconComponent = getFileIcon(type, extension);
|
|
2447
2404
|
const iconSize = compact ? 24 : 32;
|
|
2448
|
-
const iconColor = type === "directory" ? "text-(--color-text-tertiary)" : "text-(--color-text-secondary)";
|
|
2449
2405
|
const thumbnailClass = compact ? "aspect-square rounded-t-(--border-radius-md)" : "aspect-[4/3] rounded-t-(--border-radius-lg)";
|
|
2450
2406
|
const handleInfoClick = useCallback3(
|
|
2451
2407
|
(e) => {
|
|
@@ -2471,7 +2427,7 @@ function FileCard({
|
|
|
2471
2427
|
"div",
|
|
2472
2428
|
{
|
|
2473
2429
|
className: `shrink-0 overflow-hidden bg-neutral-900 ${thumbnailClass}`,
|
|
2474
|
-
children: children ? /* @__PURE__ */ jsx37("div", { className: "h-full w-full overflow-hidden", children }) : /* @__PURE__ */ jsx37("div", { className: "flex h-full w-full items-center justify-center", children: /* @__PURE__ */ jsx37(IconComponent, { size: iconSize, className:
|
|
2430
|
+
children: children ? /* @__PURE__ */ jsx37("div", { className: "h-full w-full overflow-hidden", children }) : /* @__PURE__ */ jsx37("div", { className: "flex h-full w-full items-center justify-center", children: /* @__PURE__ */ jsx37(IconComponent, { size: iconSize, className: "text-(--color-text-secondary)" }) })
|
|
2475
2431
|
}
|
|
2476
2432
|
),
|
|
2477
2433
|
/* @__PURE__ */ jsx37(
|
|
@@ -2484,7 +2440,13 @@ function FileCard({
|
|
|
2484
2440
|
].join(" "),
|
|
2485
2441
|
children: compact ? /* @__PURE__ */ jsx37("span", { className: "text-xs font-medium text-(--color-text-primary) truncate", children: name }) : /* @__PURE__ */ jsxs23(Fragment9, { children: [
|
|
2486
2442
|
/* @__PURE__ */ jsxs23("span", { className: "flex items-center gap-1.5", children: [
|
|
2487
|
-
/* @__PURE__ */ jsx37(
|
|
2443
|
+
/* @__PURE__ */ jsx37(
|
|
2444
|
+
IconComponent,
|
|
2445
|
+
{
|
|
2446
|
+
size: 16,
|
|
2447
|
+
className: "shrink-0 text-(--color-text-secondary)"
|
|
2448
|
+
}
|
|
2449
|
+
),
|
|
2488
2450
|
/* @__PURE__ */ jsx37("span", { className: "min-w-0 flex-1 text-sm font-medium text-(--color-text-primary) truncate", children: name }),
|
|
2489
2451
|
onInfo && /* @__PURE__ */ jsx37(
|
|
2490
2452
|
"span",
|
|
@@ -2525,17 +2487,6 @@ function FileCard({
|
|
|
2525
2487
|
isInteractive && "focus-visible:ring-2 focus-visible:ring-(--color-border-focus) focus-visible:ring-offset-2 outline-none",
|
|
2526
2488
|
className
|
|
2527
2489
|
].filter(Boolean).join(" ");
|
|
2528
|
-
if (href) {
|
|
2529
|
-
return /* @__PURE__ */ jsx37(
|
|
2530
|
-
"a",
|
|
2531
|
-
{
|
|
2532
|
-
href,
|
|
2533
|
-
"aria-label": name,
|
|
2534
|
-
className: [baseStyles, "no-underline"].join(" "),
|
|
2535
|
-
children: cardContent
|
|
2536
|
-
}
|
|
2537
|
-
);
|
|
2538
|
-
}
|
|
2539
2490
|
if (onPress) {
|
|
2540
2491
|
return /* @__PURE__ */ jsx37(
|
|
2541
2492
|
"div",
|
|
@@ -3778,7 +3729,6 @@ export {
|
|
|
3778
3729
|
Field,
|
|
3779
3730
|
Fieldset,
|
|
3780
3731
|
FileCard,
|
|
3781
|
-
FileIcon,
|
|
3782
3732
|
FontSize2xl,
|
|
3783
3733
|
FontSize3xl,
|
|
3784
3734
|
FontSize4xl,
|
|
@@ -3864,8 +3814,6 @@ export {
|
|
|
3864
3814
|
TabPanel2 as UnstyledTabPanel,
|
|
3865
3815
|
Tabs2 as UnstyledTabs,
|
|
3866
3816
|
createToastBridge,
|
|
3867
|
-
getFileIcon,
|
|
3868
|
-
getTypeLabel,
|
|
3869
3817
|
pillColorFromName,
|
|
3870
3818
|
useFormWizard,
|
|
3871
3819
|
useInputGroup,
|