@moving-walls/design-system 1.0.13 → 1.0.14

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.
@@ -0,0 +1,33 @@
1
+ import React from "react";
2
+ export interface ConfirmSheetProps {
3
+ /** Controls open/close state */
4
+ open: boolean;
5
+ onOpenChange: (open: boolean) => void;
6
+ /** Sheet header title */
7
+ title: string;
8
+ /** Optional descriptive text below the title */
9
+ description?: string | React.ReactNode;
10
+ /** Optional additional body content (e.g. item name, warnings) */
11
+ children?: React.ReactNode;
12
+ /** Label for the confirm button. Defaults to "Confirm" */
13
+ confirmLabel?: string;
14
+ /** Label for the cancel button. Defaults to "Cancel" */
15
+ cancelLabel?: string;
16
+ /**
17
+ * Visual variant:
18
+ * - "destructive" → red confirm button + trash icon (delete actions)
19
+ * - "warning" → amber confirm button + warning icon (irreversible actions)
20
+ * - "default" → primary blue confirm button (neutral confirmations)
21
+ */
22
+ variant?: "destructive" | "warning" | "default";
23
+ /** Shows a loading spinner on the confirm button and disables both buttons */
24
+ isLoading?: boolean;
25
+ /** Called when the user clicks the confirm button */
26
+ onConfirm: () => void;
27
+ /** Called when the user clicks cancel. Defaults to closing the sheet. */
28
+ onCancel?: () => void;
29
+ }
30
+ export declare function ConfirmSheet({ open, onOpenChange, title, description, children, confirmLabel, cancelLabel, variant, isLoading, onConfirm, onCancel, }: ConfirmSheetProps): import("react/jsx-runtime").JSX.Element;
31
+ export declare namespace ConfirmSheet {
32
+ var displayName: string;
33
+ }
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ export interface ImageProps extends React.ImgHTMLAttributes<HTMLImageElement> {
3
+ /** Alt text is required — enforces accessibility */
4
+ alt: string;
5
+ /** Default lazy loading. Pass "eager" for above-the-fold images */
6
+ loading?: 'lazy' | 'eager';
7
+ }
8
+ /**
9
+ * Design system Image component.
10
+ * - Wraps native <img> so alt is a required prop (accessibility enforcement)
11
+ * - Defaults to loading="lazy" for performance
12
+ * - Use this instead of native <img> anywhere in the application
13
+ */
14
+ export declare function Image({ alt, loading, ...props }: ImageProps): import("react/jsx-runtime").JSX.Element;
15
+ export declare namespace Image {
16
+ var displayName: string;
17
+ }
@@ -62,6 +62,8 @@ export { TreeView, findTreeNode, getAllNodeIds, getParentIds } from './TreeView'
62
62
  export { Modal, ModalHeader, ModalBody, ModalFooter } from './Modal';
63
63
  export { Dialog, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, DialogTrigger } from './Dialog';
64
64
  export { Sheet, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, SheetTrigger } from './Sheet';
65
+ export { ConfirmSheet } from './ConfirmSheet';
66
+ export type { ConfirmSheetProps } from './ConfirmSheet';
65
67
  export { Popover, PopoverTrigger, PopoverContent } from './Popover';
66
68
  export { Dropdown, DropdownTrigger, DropdownContent, DropdownItem, DropdownSeparator } from './Dropdown';
67
69
  export { Tooltip } from './Tooltip';
@@ -75,6 +77,8 @@ export { Notification, NotificationList, NotificationBadge, NotificationBell } f
75
77
  export { DataGrid } from './DataGrid';
76
78
  export type { DataGridColumn, DataGridSort, DataGridFilter, DataGridSelection } from './DataGrid';
77
79
  export { Thumbnail, VideoThumbnail, ImageThumbnail, ThumbnailGallery } from './Thumbnail';
80
+ export { Image } from './Image';
81
+ export type { ImageProps } from './Image';
78
82
  export { DragDrop, SortableList, useDragDrop } from './DragDrop';
79
83
  export { Heading, Text, Label, Display } from './Typography';
80
84
  export type { HeadingProps, TextProps, LabelProps, DisplayProps } from './Typography';
package/dist/index.esm.js CHANGED
@@ -12226,7 +12226,7 @@ const ImageUpscale = createLucideIcon("ImageUpscale", [
12226
12226
  * This source code is licensed under the ISC license.
12227
12227
  * See the LICENSE file in the root directory of this source tree.
12228
12228
  */
12229
- const Image = createLucideIcon("Image", [
12229
+ const Image$1 = createLucideIcon("Image", [
12230
12230
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2", key: "1m3agn" }],
12231
12231
  ["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }],
12232
12232
  ["path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21", key: "1xmnt7" }]
@@ -24696,7 +24696,7 @@ var index$1 = /*#__PURE__*/Object.freeze({
24696
24696
  IceCreamBowl: IceCreamBowl,
24697
24697
  IceCreamCone: IceCreamCone,
24698
24698
  IdCard: IdCard,
24699
- Image: Image,
24699
+ Image: Image$1,
24700
24700
  ImageDown: ImageDown,
24701
24701
  ImageMinus: ImageMinus,
24702
24702
  ImageOff: ImageOff,
@@ -27215,10 +27215,10 @@ var LucideIcons = /*#__PURE__*/Object.freeze({
27215
27215
  Icon: Icon$1,
27216
27216
  IdCard: IdCard,
27217
27217
  IdCardIcon: IdCard,
27218
- Image: Image,
27218
+ Image: Image$1,
27219
27219
  ImageDown: ImageDown,
27220
27220
  ImageDownIcon: ImageDown,
27221
- ImageIcon: Image,
27221
+ ImageIcon: Image$1,
27222
27222
  ImageMinus: ImageMinus,
27223
27223
  ImageMinusIcon: ImageMinus,
27224
27224
  ImageOff: ImageOff,
@@ -28293,7 +28293,7 @@ var LucideIcons = /*#__PURE__*/Object.freeze({
28293
28293
  LucideIceCreamBowl: IceCreamBowl,
28294
28294
  LucideIceCreamCone: IceCreamCone,
28295
28295
  LucideIdCard: IdCard,
28296
- LucideImage: Image,
28296
+ LucideImage: Image$1,
28297
28297
  LucideImageDown: ImageDown,
28298
28298
  LucideImageMinus: ImageMinus,
28299
28299
  LucideImageOff: ImageOff,
@@ -37753,7 +37753,7 @@ function formatFileSize(bytes) {
37753
37753
  }
37754
37754
  function getFileIcon$1(file) {
37755
37755
  if (file.type.startsWith('image/')) {
37756
- return jsx(Image, {
37756
+ return jsx(Image$1, {
37757
37757
  className: "w-4 h-4"
37758
37758
  });
37759
37759
  }
@@ -39972,7 +39972,7 @@ function RichTextEditor(_ref2) {
39972
39972
  }), jsx(ToolbarButton, {
39973
39973
  onClick: formatCommands.image,
39974
39974
  title: "Insert Image",
39975
- children: jsx(Image, {
39975
+ children: jsx(Image$1, {
39976
39976
  className: "w-4 h-4"
39977
39977
  })
39978
39978
  })]
@@ -42486,7 +42486,7 @@ var emptyStateIcons = {
42486
42486
  folder: jsx(FolderOpen, {
42487
42487
  className: "w-12 h-12 text-mw-neutral-400"
42488
42488
  }),
42489
- image: jsx(Image, {
42489
+ image: jsx(Image$1, {
42490
42490
  className: "w-12 h-12 text-mw-neutral-400"
42491
42491
  }),
42492
42492
  document: jsx(FileText, {
@@ -45777,6 +45777,101 @@ function SheetDescription(_a) {
45777
45777
  }));
45778
45778
  }
45779
45779
 
45780
+ var variantConfig = {
45781
+ destructive: {
45782
+ icon: Trash2,
45783
+ iconClass: "text-red-500",
45784
+ bgClass: "bg-red-50 dark:bg-red-950/30",
45785
+ buttonClass: "bg-red-600 hover:bg-red-700 text-white border-transparent"
45786
+ },
45787
+ warning: {
45788
+ icon: TriangleAlert,
45789
+ iconClass: "text-amber-500",
45790
+ bgClass: "bg-amber-50 dark:bg-amber-950/30",
45791
+ buttonClass: "bg-amber-500 hover:bg-amber-600 text-white border-transparent"
45792
+ },
45793
+ "default": {
45794
+ icon: Info,
45795
+ iconClass: "text-mw-primary-500",
45796
+ bgClass: "bg-mw-primary-50 dark:bg-mw-primary-950/30",
45797
+ buttonClass: undefined // uses Button variant="primary"
45798
+ }
45799
+ };
45800
+ function ConfirmSheet(_ref) {
45801
+ var open = _ref.open,
45802
+ onOpenChange = _ref.onOpenChange,
45803
+ title = _ref.title,
45804
+ description = _ref.description,
45805
+ children = _ref.children,
45806
+ _ref$confirmLabel = _ref.confirmLabel,
45807
+ confirmLabel = _ref$confirmLabel === void 0 ? "Confirm" : _ref$confirmLabel,
45808
+ _ref$cancelLabel = _ref.cancelLabel,
45809
+ cancelLabel = _ref$cancelLabel === void 0 ? "Cancel" : _ref$cancelLabel,
45810
+ _ref$variant = _ref.variant,
45811
+ variant = _ref$variant === void 0 ? "default" : _ref$variant,
45812
+ _ref$isLoading = _ref.isLoading,
45813
+ isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
45814
+ onConfirm = _ref.onConfirm,
45815
+ onCancel = _ref.onCancel;
45816
+ var config = variantConfig[variant];
45817
+ var Icon = config.icon;
45818
+ var handleCancel = function handleCancel() {
45819
+ if (onCancel) {
45820
+ onCancel();
45821
+ } else {
45822
+ onOpenChange(false);
45823
+ }
45824
+ };
45825
+ return jsx(Sheet, {
45826
+ open: open,
45827
+ onOpenChange: onOpenChange,
45828
+ children: jsxs(SheetContent, {
45829
+ side: "right",
45830
+ size: "sm",
45831
+ className: "flex flex-col p-0",
45832
+ children: [jsx(SheetHeader, {
45833
+ className: "px-6 py-5 border-b border-mw-neutral-200 dark:border-mw-neutral-700 flex-shrink-0",
45834
+ children: jsx(SheetTitle, {
45835
+ children: title
45836
+ })
45837
+ }), jsxs("div", {
45838
+ className: "flex-1 overflow-auto min-h-0 px-6 py-5 space-y-4",
45839
+ children: [jsxs("div", {
45840
+ className: clsx("flex items-start gap-3 rounded-lg p-4", config.bgClass),
45841
+ children: [jsx(Icon, {
45842
+ className: clsx("h-5 w-5 mt-0.5 flex-shrink-0", config.iconClass)
45843
+ }), description && jsx("div", {
45844
+ className: "text-sm text-mw-neutral-700 dark:text-mw-neutral-300",
45845
+ children: description
45846
+ })]
45847
+ }), children && jsx("div", {
45848
+ className: "text-sm text-mw-neutral-600 dark:text-mw-neutral-400",
45849
+ children: children
45850
+ })]
45851
+ }), jsxs(SheetFooter, {
45852
+ className: "flex-shrink-0 border-t border-mw-neutral-200 dark:border-mw-neutral-700 px-6 py-4",
45853
+ children: [jsx(Button, {
45854
+ variant: "outline",
45855
+ onClick: handleCancel,
45856
+ disabled: isLoading,
45857
+ children: cancelLabel
45858
+ }), variant === "default" ? jsx(Button, {
45859
+ variant: "primary",
45860
+ onClick: onConfirm,
45861
+ disabled: isLoading,
45862
+ children: isLoading ? "Loading..." : confirmLabel
45863
+ }) : jsx("button", {
45864
+ onClick: onConfirm,
45865
+ disabled: isLoading,
45866
+ className: clsx("inline-flex items-center justify-center gap-2 rounded-md px-4 py-2 text-sm font-medium transition-colors", "disabled:opacity-50 disabled:cursor-not-allowed", config.buttonClass),
45867
+ children: isLoading ? "Loading..." : confirmLabel
45868
+ })]
45869
+ })]
45870
+ })
45871
+ });
45872
+ }
45873
+ ConfirmSheet.displayName = "ConfirmSheet";
45874
+
45780
45875
  var PopoverContext = /*#__PURE__*/createContext(null);
45781
45876
  function Popover(_ref) {
45782
45877
  var _ref$open = _ref.open,
@@ -48307,6 +48402,24 @@ function ThumbnailGallery(_ref2) {
48307
48402
  });
48308
48403
  }
48309
48404
 
48405
+ /**
48406
+ * Design system Image component.
48407
+ * - Wraps native <img> so alt is a required prop (accessibility enforcement)
48408
+ * - Defaults to loading="lazy" for performance
48409
+ * - Use this instead of native <img> anywhere in the application
48410
+ */
48411
+ function Image(_a) {
48412
+ var alt = _a.alt,
48413
+ _a$loading = _a.loading,
48414
+ loading = _a$loading === void 0 ? 'lazy' : _a$loading,
48415
+ props = __rest$1(_a, ["alt", "loading"]);
48416
+ return jsx("img", Object.assign({
48417
+ alt: alt,
48418
+ loading: loading
48419
+ }, props));
48420
+ }
48421
+ Image.displayName = 'Image';
48422
+
48310
48423
  function cn$3() {
48311
48424
  for (var _len = arguments.length, classes = new Array(_len), _key = 0; _key < _len; _key++) {
48312
48425
  classes[_key] = arguments[_key];
@@ -48412,7 +48525,7 @@ function useDragDrop(_ref) {
48412
48525
  function getFileIcon(file) {
48413
48526
  var type = file.type;
48414
48527
  var name = file.name.toLowerCase();
48415
- if (type.startsWith('image/')) return jsx(Image, {
48528
+ if (type.startsWith('image/')) return jsx(Image$1, {
48416
48529
  className: "w-6 h-6"
48417
48530
  });
48418
48531
  if (type.startsWith('video/')) return jsx(Video, {
@@ -57026,5 +57139,5 @@ function getShortcutCategory(shortcut) {
57026
57139
  // Version
57027
57140
  var version = '1.0.0';
57028
57141
 
57029
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AdvancedTable, AgGridTable, Alert, AlertCircleIcon, AlertTriangleIcon, AnimatedElement, AppHeader, Autocomplete, Avatar, AvatarFallback, AvatarGroup, AvatarImage, Badge, Breadcrumb, BreadcrumbItem, BreadcrumbSeparator, Button, Calendar, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselSlide, CheckIcon, Checkbox, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, Chip, CloseIcon, CodeSnippet, Collapsible, CollapsibleCode, CollapsibleContent, CollapsibleTrigger, ColumnCustomizationDrawer, Command, CommandGroup, CommandItem, CommandSeparator, Container, CounterAnimation, DataGrid, DatePicker, DateRangePicker, DescriptionList, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, Display, DocumentEditor, DragDrop, Dropdown, DropdownContent, DropdownItem, Dropdown as DropdownMenu, DropdownContent as DropdownMenuContent, DropdownItem as DropdownMenuItem, DropdownMenuLabel, DropdownSeparator as DropdownMenuSeparator, DropdownTrigger as DropdownMenuTrigger, DropdownSeparator, DropdownTrigger, DynamicIcon, EmptyState, Fieldset, FileUpload, Filter, FlexContainer, FloatingElement, Footer, Form, FormActions, FormControl, FormDescription, FormError, FormField, FormGroup, FormItem, FormLabel, FormMessage, FormSection, GridContainer, HStack, Heading, Icon$2 as Icon, ImageCarousel, ImageThumbnail, InfoIcon, Input, Label, List, ListItem, Loading, MWBounceLoader, MWBrandLoader, MWDotsLoader, MWHeartbeatLoader, MWLoader, MWMatrixLoader, MWProgressiveLoader, Menu, MenuCheckboxItem, MenuGroup, MenuItem, MenuRadioGroup, MenuRadioItem, MenuSeparator, MinusIcon, Modal, ModalBody, ModalFooter, ModalHeader, MultiSelect, Navigation, NavigationList, NoDataEmptyState, NoResultsEmptyState, Notification, NotificationBadge, NotificationBell, NotificationList, PageHeader, PageHero, Pagination, Panel, PanelGroup, PanelHeader, PanelResizer, PlusIcon, Popover, PopoverContent, PopoverTrigger, ProcessFlowAnimation, Progress, Radio$1 as Radio, RadioGroup, RadioGroupItem, Rating, ResponsiveContainer, RichTextEditor, ScheduleGrid, ScrollArea, SearchBar, SearchIcon, SearchResults, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectRoot, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarCollapseToggle, SidebarContent, SidebarFooter, SidebarGroup, SidebarHeader, SidebarItem, SidebarNav, SidebarPanel, SidebarProvider, SidebarToggleButton, SidebarTrigger, SimpleSelect, Skeleton, Slider, SnackbarProvider, SortableList, Spinner, SplitPanel, Stack, StackPanel, StatusBadge, Stepper, Switch, SwitchGroup, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, Text, Textarea, ThemeToggle, Thumbnail, ThumbnailGallery, TimePicker, TimeRangePicker, Timeline, TimelineItem, ToastProvider, ToggleGroup, ToggleGroupItem, Tooltip, TreeView, VideoThumbnail, borderRadius, borderWidth, breakpoints, cn, colors, cssVariables, debounce, effects, findTreeNode, formatIconName$1 as formatIconName, generateColorVariations, generateIconCode, getAllNodeIds, getParentIds, hexToRgb, shadows, spacing, tokens, typography, useDragDrop, useFormContext, useIconSearch, useKeyboardShortcuts, useSidebar, useSidebarSafe, useSnackbar, useSnackbarHelpers, useToast, version, zIndex };
57142
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AdvancedTable, AgGridTable, Alert, AlertCircleIcon, AlertTriangleIcon, AnimatedElement, AppHeader, Autocomplete, Avatar, AvatarFallback, AvatarGroup, AvatarImage, Badge, Breadcrumb, BreadcrumbItem, BreadcrumbSeparator, Button, Calendar, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselSlide, CheckIcon, Checkbox, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, Chip, CloseIcon, CodeSnippet, Collapsible, CollapsibleCode, CollapsibleContent, CollapsibleTrigger, ColumnCustomizationDrawer, Command, CommandGroup, CommandItem, CommandSeparator, ConfirmSheet, Container, CounterAnimation, DataGrid, DatePicker, DateRangePicker, DescriptionList, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, Display, DocumentEditor, DragDrop, Dropdown, DropdownContent, DropdownItem, Dropdown as DropdownMenu, DropdownContent as DropdownMenuContent, DropdownItem as DropdownMenuItem, DropdownMenuLabel, DropdownSeparator as DropdownMenuSeparator, DropdownTrigger as DropdownMenuTrigger, DropdownSeparator, DropdownTrigger, DynamicIcon, EmptyState, Fieldset, FileUpload, Filter, FlexContainer, FloatingElement, Footer, Form, FormActions, FormControl, FormDescription, FormError, FormField, FormGroup, FormItem, FormLabel, FormMessage, FormSection, GridContainer, HStack, Heading, Icon$2 as Icon, Image, ImageCarousel, ImageThumbnail, InfoIcon, Input, Label, List, ListItem, Loading, MWBounceLoader, MWBrandLoader, MWDotsLoader, MWHeartbeatLoader, MWLoader, MWMatrixLoader, MWProgressiveLoader, Menu, MenuCheckboxItem, MenuGroup, MenuItem, MenuRadioGroup, MenuRadioItem, MenuSeparator, MinusIcon, Modal, ModalBody, ModalFooter, ModalHeader, MultiSelect, Navigation, NavigationList, NoDataEmptyState, NoResultsEmptyState, Notification, NotificationBadge, NotificationBell, NotificationList, PageHeader, PageHero, Pagination, Panel, PanelGroup, PanelHeader, PanelResizer, PlusIcon, Popover, PopoverContent, PopoverTrigger, ProcessFlowAnimation, Progress, Radio$1 as Radio, RadioGroup, RadioGroupItem, Rating, ResponsiveContainer, RichTextEditor, ScheduleGrid, ScrollArea, SearchBar, SearchIcon, SearchResults, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectRoot, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarCollapseToggle, SidebarContent, SidebarFooter, SidebarGroup, SidebarHeader, SidebarItem, SidebarNav, SidebarPanel, SidebarProvider, SidebarToggleButton, SidebarTrigger, SimpleSelect, Skeleton, Slider, SnackbarProvider, SortableList, Spinner, SplitPanel, Stack, StackPanel, StatusBadge, Stepper, Switch, SwitchGroup, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, Text, Textarea, ThemeToggle, Thumbnail, ThumbnailGallery, TimePicker, TimeRangePicker, Timeline, TimelineItem, ToastProvider, ToggleGroup, ToggleGroupItem, Tooltip, TreeView, VideoThumbnail, borderRadius, borderWidth, breakpoints, cn, colors, cssVariables, debounce, effects, findTreeNode, formatIconName$1 as formatIconName, generateColorVariations, generateIconCode, getAllNodeIds, getParentIds, hexToRgb, shadows, spacing, tokens, typography, useDragDrop, useFormContext, useIconSearch, useKeyboardShortcuts, useSidebar, useSidebarSafe, useSnackbar, useSnackbarHelpers, useToast, version, zIndex };
57030
57143
  //# sourceMappingURL=index.esm.js.map