@moving-walls/design-system 1.0.13 → 1.0.15
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/components/ui/ConfirmSheet.d.ts +33 -0
- package/dist/components/ui/Form.d.ts +2 -1
- package/dist/components/ui/Image.d.ts +17 -0
- package/dist/components/ui/index.d.ts +4 -0
- package/dist/index.esm.js +126 -11
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +127 -10
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -12246,7 +12246,7 @@ const ImageUpscale = createLucideIcon("ImageUpscale", [
|
|
|
12246
12246
|
* This source code is licensed under the ISC license.
|
|
12247
12247
|
* See the LICENSE file in the root directory of this source tree.
|
|
12248
12248
|
*/
|
|
12249
|
-
const Image = createLucideIcon("Image", [
|
|
12249
|
+
const Image$1 = createLucideIcon("Image", [
|
|
12250
12250
|
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2", key: "1m3agn" }],
|
|
12251
12251
|
["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }],
|
|
12252
12252
|
["path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21", key: "1xmnt7" }]
|
|
@@ -24716,7 +24716,7 @@ var index$1 = /*#__PURE__*/Object.freeze({
|
|
|
24716
24716
|
IceCreamBowl: IceCreamBowl,
|
|
24717
24717
|
IceCreamCone: IceCreamCone,
|
|
24718
24718
|
IdCard: IdCard,
|
|
24719
|
-
Image: Image,
|
|
24719
|
+
Image: Image$1,
|
|
24720
24720
|
ImageDown: ImageDown,
|
|
24721
24721
|
ImageMinus: ImageMinus,
|
|
24722
24722
|
ImageOff: ImageOff,
|
|
@@ -27235,10 +27235,10 @@ var LucideIcons = /*#__PURE__*/Object.freeze({
|
|
|
27235
27235
|
Icon: Icon$1,
|
|
27236
27236
|
IdCard: IdCard,
|
|
27237
27237
|
IdCardIcon: IdCard,
|
|
27238
|
-
Image: Image,
|
|
27238
|
+
Image: Image$1,
|
|
27239
27239
|
ImageDown: ImageDown,
|
|
27240
27240
|
ImageDownIcon: ImageDown,
|
|
27241
|
-
ImageIcon: Image,
|
|
27241
|
+
ImageIcon: Image$1,
|
|
27242
27242
|
ImageMinus: ImageMinus,
|
|
27243
27243
|
ImageMinusIcon: ImageMinus,
|
|
27244
27244
|
ImageOff: ImageOff,
|
|
@@ -28313,7 +28313,7 @@ var LucideIcons = /*#__PURE__*/Object.freeze({
|
|
|
28313
28313
|
LucideIceCreamBowl: IceCreamBowl,
|
|
28314
28314
|
LucideIceCreamCone: IceCreamCone,
|
|
28315
28315
|
LucideIdCard: IdCard,
|
|
28316
|
-
LucideImage: Image,
|
|
28316
|
+
LucideImage: Image$1,
|
|
28317
28317
|
LucideImageDown: ImageDown,
|
|
28318
28318
|
LucideImageMinus: ImageMinus,
|
|
28319
28319
|
LucideImageOff: ImageOff,
|
|
@@ -37588,7 +37588,8 @@ function Form(_ref) {
|
|
|
37588
37588
|
_ref$size = _ref.size,
|
|
37589
37589
|
size = _ref$size === void 0 ? 'md' : _ref$size,
|
|
37590
37590
|
_ref$layout = _ref.layout,
|
|
37591
|
-
layout = _ref$layout === void 0 ? 'vertical' : _ref$layout
|
|
37591
|
+
layout = _ref$layout === void 0 ? 'vertical' : _ref$layout,
|
|
37592
|
+
id = _ref.id;
|
|
37592
37593
|
var handleSubmit = function handleSubmit(event) {
|
|
37593
37594
|
if (onSubmit) {
|
|
37594
37595
|
event.preventDefault();
|
|
@@ -37601,6 +37602,7 @@ function Form(_ref) {
|
|
|
37601
37602
|
size: size
|
|
37602
37603
|
},
|
|
37603
37604
|
children: require$$1.jsx("form", {
|
|
37605
|
+
id: id,
|
|
37604
37606
|
onSubmit: handleSubmit,
|
|
37605
37607
|
className: cn$m(formLayouts[layout], formSizes[size], className),
|
|
37606
37608
|
children: children
|
|
@@ -37773,7 +37775,7 @@ function formatFileSize(bytes) {
|
|
|
37773
37775
|
}
|
|
37774
37776
|
function getFileIcon$1(file) {
|
|
37775
37777
|
if (file.type.startsWith('image/')) {
|
|
37776
|
-
return require$$1.jsx(Image, {
|
|
37778
|
+
return require$$1.jsx(Image$1, {
|
|
37777
37779
|
className: "w-4 h-4"
|
|
37778
37780
|
});
|
|
37779
37781
|
}
|
|
@@ -39992,7 +39994,7 @@ function RichTextEditor(_ref2) {
|
|
|
39992
39994
|
}), require$$1.jsx(ToolbarButton, {
|
|
39993
39995
|
onClick: formatCommands.image,
|
|
39994
39996
|
title: "Insert Image",
|
|
39995
|
-
children: require$$1.jsx(Image, {
|
|
39997
|
+
children: require$$1.jsx(Image$1, {
|
|
39996
39998
|
className: "w-4 h-4"
|
|
39997
39999
|
})
|
|
39998
40000
|
})]
|
|
@@ -42506,7 +42508,7 @@ var emptyStateIcons = {
|
|
|
42506
42508
|
folder: require$$1.jsx(FolderOpen, {
|
|
42507
42509
|
className: "w-12 h-12 text-mw-neutral-400"
|
|
42508
42510
|
}),
|
|
42509
|
-
image: require$$1.jsx(Image, {
|
|
42511
|
+
image: require$$1.jsx(Image$1, {
|
|
42510
42512
|
className: "w-12 h-12 text-mw-neutral-400"
|
|
42511
42513
|
}),
|
|
42512
42514
|
document: require$$1.jsx(FileText, {
|
|
@@ -45797,6 +45799,101 @@ function SheetDescription(_a) {
|
|
|
45797
45799
|
}));
|
|
45798
45800
|
}
|
|
45799
45801
|
|
|
45802
|
+
var variantConfig = {
|
|
45803
|
+
destructive: {
|
|
45804
|
+
icon: Trash2,
|
|
45805
|
+
iconClass: "text-red-500",
|
|
45806
|
+
bgClass: "bg-red-50 dark:bg-red-950/30",
|
|
45807
|
+
buttonClass: "bg-red-600 hover:bg-red-700 text-white border-transparent"
|
|
45808
|
+
},
|
|
45809
|
+
warning: {
|
|
45810
|
+
icon: TriangleAlert,
|
|
45811
|
+
iconClass: "text-amber-500",
|
|
45812
|
+
bgClass: "bg-amber-50 dark:bg-amber-950/30",
|
|
45813
|
+
buttonClass: "bg-amber-500 hover:bg-amber-600 text-white border-transparent"
|
|
45814
|
+
},
|
|
45815
|
+
"default": {
|
|
45816
|
+
icon: Info,
|
|
45817
|
+
iconClass: "text-mw-primary-500",
|
|
45818
|
+
bgClass: "bg-mw-primary-50 dark:bg-mw-primary-950/30",
|
|
45819
|
+
buttonClass: undefined // uses Button variant="primary"
|
|
45820
|
+
}
|
|
45821
|
+
};
|
|
45822
|
+
function ConfirmSheet(_ref) {
|
|
45823
|
+
var open = _ref.open,
|
|
45824
|
+
onOpenChange = _ref.onOpenChange,
|
|
45825
|
+
title = _ref.title,
|
|
45826
|
+
description = _ref.description,
|
|
45827
|
+
children = _ref.children,
|
|
45828
|
+
_ref$confirmLabel = _ref.confirmLabel,
|
|
45829
|
+
confirmLabel = _ref$confirmLabel === void 0 ? "Confirm" : _ref$confirmLabel,
|
|
45830
|
+
_ref$cancelLabel = _ref.cancelLabel,
|
|
45831
|
+
cancelLabel = _ref$cancelLabel === void 0 ? "Cancel" : _ref$cancelLabel,
|
|
45832
|
+
_ref$variant = _ref.variant,
|
|
45833
|
+
variant = _ref$variant === void 0 ? "default" : _ref$variant,
|
|
45834
|
+
_ref$isLoading = _ref.isLoading,
|
|
45835
|
+
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
|
|
45836
|
+
onConfirm = _ref.onConfirm,
|
|
45837
|
+
onCancel = _ref.onCancel;
|
|
45838
|
+
var config = variantConfig[variant];
|
|
45839
|
+
var Icon = config.icon;
|
|
45840
|
+
var handleCancel = function handleCancel() {
|
|
45841
|
+
if (onCancel) {
|
|
45842
|
+
onCancel();
|
|
45843
|
+
} else {
|
|
45844
|
+
onOpenChange(false);
|
|
45845
|
+
}
|
|
45846
|
+
};
|
|
45847
|
+
return require$$1.jsx(Sheet, {
|
|
45848
|
+
open: open,
|
|
45849
|
+
onOpenChange: onOpenChange,
|
|
45850
|
+
children: require$$1.jsxs(SheetContent, {
|
|
45851
|
+
side: "right",
|
|
45852
|
+
size: "sm",
|
|
45853
|
+
className: "flex flex-col p-0",
|
|
45854
|
+
children: [require$$1.jsx(SheetHeader, {
|
|
45855
|
+
className: "px-6 py-5 border-b border-mw-neutral-200 dark:border-mw-neutral-700 flex-shrink-0",
|
|
45856
|
+
children: require$$1.jsx(SheetTitle, {
|
|
45857
|
+
children: title
|
|
45858
|
+
})
|
|
45859
|
+
}), require$$1.jsxs("div", {
|
|
45860
|
+
className: "flex-1 overflow-auto min-h-0 px-6 py-5 space-y-4",
|
|
45861
|
+
children: [require$$1.jsxs("div", {
|
|
45862
|
+
className: clsx("flex items-start gap-3 rounded-lg p-4", config.bgClass),
|
|
45863
|
+
children: [require$$1.jsx(Icon, {
|
|
45864
|
+
className: clsx("h-5 w-5 mt-0.5 flex-shrink-0", config.iconClass)
|
|
45865
|
+
}), description && require$$1.jsx("div", {
|
|
45866
|
+
className: "text-sm text-mw-neutral-700 dark:text-mw-neutral-300",
|
|
45867
|
+
children: description
|
|
45868
|
+
})]
|
|
45869
|
+
}), children && require$$1.jsx("div", {
|
|
45870
|
+
className: "text-sm text-mw-neutral-600 dark:text-mw-neutral-400",
|
|
45871
|
+
children: children
|
|
45872
|
+
})]
|
|
45873
|
+
}), require$$1.jsxs(SheetFooter, {
|
|
45874
|
+
className: "flex-shrink-0 border-t border-mw-neutral-200 dark:border-mw-neutral-700 px-6 py-4",
|
|
45875
|
+
children: [require$$1.jsx(Button, {
|
|
45876
|
+
variant: "outline",
|
|
45877
|
+
onClick: handleCancel,
|
|
45878
|
+
disabled: isLoading,
|
|
45879
|
+
children: cancelLabel
|
|
45880
|
+
}), variant === "default" ? require$$1.jsx(Button, {
|
|
45881
|
+
variant: "primary",
|
|
45882
|
+
onClick: onConfirm,
|
|
45883
|
+
disabled: isLoading,
|
|
45884
|
+
children: isLoading ? "Loading..." : confirmLabel
|
|
45885
|
+
}) : require$$1.jsx("button", {
|
|
45886
|
+
onClick: onConfirm,
|
|
45887
|
+
disabled: isLoading,
|
|
45888
|
+
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),
|
|
45889
|
+
children: isLoading ? "Loading..." : confirmLabel
|
|
45890
|
+
})]
|
|
45891
|
+
})]
|
|
45892
|
+
})
|
|
45893
|
+
});
|
|
45894
|
+
}
|
|
45895
|
+
ConfirmSheet.displayName = "ConfirmSheet";
|
|
45896
|
+
|
|
45800
45897
|
var PopoverContext = /*#__PURE__*/React.createContext(null);
|
|
45801
45898
|
function Popover(_ref) {
|
|
45802
45899
|
var _ref$open = _ref.open,
|
|
@@ -48327,6 +48424,24 @@ function ThumbnailGallery(_ref2) {
|
|
|
48327
48424
|
});
|
|
48328
48425
|
}
|
|
48329
48426
|
|
|
48427
|
+
/**
|
|
48428
|
+
* Design system Image component.
|
|
48429
|
+
* - Wraps native <img> so alt is a required prop (accessibility enforcement)
|
|
48430
|
+
* - Defaults to loading="lazy" for performance
|
|
48431
|
+
* - Use this instead of native <img> anywhere in the application
|
|
48432
|
+
*/
|
|
48433
|
+
function Image(_a) {
|
|
48434
|
+
var alt = _a.alt,
|
|
48435
|
+
_a$loading = _a.loading,
|
|
48436
|
+
loading = _a$loading === void 0 ? 'lazy' : _a$loading,
|
|
48437
|
+
props = __rest$1(_a, ["alt", "loading"]);
|
|
48438
|
+
return require$$1.jsx("img", Object.assign({
|
|
48439
|
+
alt: alt,
|
|
48440
|
+
loading: loading
|
|
48441
|
+
}, props));
|
|
48442
|
+
}
|
|
48443
|
+
Image.displayName = 'Image';
|
|
48444
|
+
|
|
48330
48445
|
function cn$3() {
|
|
48331
48446
|
for (var _len = arguments.length, classes = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
48332
48447
|
classes[_key] = arguments[_key];
|
|
@@ -48432,7 +48547,7 @@ function useDragDrop(_ref) {
|
|
|
48432
48547
|
function getFileIcon(file) {
|
|
48433
48548
|
var type = file.type;
|
|
48434
48549
|
var name = file.name.toLowerCase();
|
|
48435
|
-
if (type.startsWith('image/')) return require$$1.jsx(Image, {
|
|
48550
|
+
if (type.startsWith('image/')) return require$$1.jsx(Image$1, {
|
|
48436
48551
|
className: "w-6 h-6"
|
|
48437
48552
|
});
|
|
48438
48553
|
if (type.startsWith('video/')) return require$$1.jsx(Video, {
|
|
@@ -57094,6 +57209,7 @@ exports.Command = Command;
|
|
|
57094
57209
|
exports.CommandGroup = CommandGroup;
|
|
57095
57210
|
exports.CommandItem = CommandItem;
|
|
57096
57211
|
exports.CommandSeparator = CommandSeparator;
|
|
57212
|
+
exports.ConfirmSheet = ConfirmSheet;
|
|
57097
57213
|
exports.Container = Container;
|
|
57098
57214
|
exports.CounterAnimation = CounterAnimation;
|
|
57099
57215
|
exports.DataGrid = DataGrid;
|
|
@@ -57144,6 +57260,7 @@ exports.GridContainer = GridContainer;
|
|
|
57144
57260
|
exports.HStack = HStack;
|
|
57145
57261
|
exports.Heading = Heading;
|
|
57146
57262
|
exports.Icon = Icon$2;
|
|
57263
|
+
exports.Image = Image;
|
|
57147
57264
|
exports.ImageCarousel = ImageCarousel;
|
|
57148
57265
|
exports.ImageThumbnail = ImageThumbnail;
|
|
57149
57266
|
exports.InfoIcon = InfoIcon;
|