@moving-walls/design-system 1.0.12 → 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.
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,
@@ -30839,8 +30839,8 @@ var Switch = /*#__PURE__*/React.forwardRef(function (_a, ref) {
30839
30839
  className: "flex items-center justify-between",
30840
30840
  children: [require$$1.jsxs("div", {
30841
30841
  className: "flex items-center space-x-3",
30842
- children: [require$$1.jsxs("div", {
30843
- className: "relative inline-flex items-center",
30842
+ children: [require$$1.jsxs("label", {
30843
+ className: "relative inline-flex items-center cursor-pointer",
30844
30844
  children: [require$$1.jsx("input", Object.assign({
30845
30845
  type: "checkbox",
30846
30846
  ref: ref,
@@ -30849,12 +30849,16 @@ var Switch = /*#__PURE__*/React.forwardRef(function (_a, ref) {
30849
30849
  onChange: handleChange,
30850
30850
  disabled: loading || props.disabled
30851
30851
  }, props)), require$$1.jsxs("div", {
30852
- className: clsx('relative rounded-full cursor-pointer', animate ? 'transition-colors duration-200' : '', 'peer-focus:ring-2 peer-focus:ring-offset-2', variantConfig.focus, 'peer-disabled:opacity-50 peer-disabled:cursor-not-allowed', error ? 'bg-mw-error-200 peer-checked:bg-mw-error-600' : checked ? variantConfig.on : variantConfig.off, sizeConfig.track, className),
30852
+ className: clsx('relative rounded-full', animate ? 'transition-colors duration-200' : '', 'peer-focus:ring-2 peer-focus:ring-offset-2', variantConfig.focus, loading || props.disabled ? 'opacity-50 cursor-not-allowed' : 'cursor-pointer', error ? 'bg-mw-error-200 peer-checked:bg-mw-error-600' : checked ? variantConfig.on : variantConfig.off, sizeConfig.track, className),
30853
30853
  children: [trackIcon && require$$1.jsx("div", {
30854
30854
  className: "absolute inset-0 flex items-center justify-center",
30855
30855
  children: trackIcon
30856
30856
  }), require$$1.jsx("div", {
30857
- className: clsx('absolute left-0.5 top-0.5 rounded-full flex items-center justify-center', animate ? 'transition-transform duration-200' : '', checked ? 'peer-checked:' + sizeConfig.translate : '', variantConfig.thumb, sizeConfig.thumb, loading && 'shadow-sm'),
30857
+ className: clsx('absolute top-0.5 rounded-full flex items-center justify-center', animate ? 'transition-transform duration-200' : '', variantConfig.thumb, sizeConfig.thumb, loading && 'shadow-sm'),
30858
+ style: {
30859
+ left: checked ? undefined : '2px',
30860
+ right: checked ? '2px' : undefined
30861
+ },
30858
30862
  children: renderThumbContent()
30859
30863
  })]
30860
30864
  })]
@@ -35747,7 +35751,7 @@ var SelectContent = /*#__PURE__*/React__namespace.forwardRef(function (_a, ref)
35747
35751
  return require$$1.jsx(Portal, {
35748
35752
  children: require$$1.jsxs(Content2, Object.assign({
35749
35753
  ref: ref,
35750
- className: clsx('relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border border-mw-neutral-200 dark:border-mw-neutral-700', 'bg-white dark:bg-mw-neutral-800 text-mw-neutral-900 dark:text-mw-neutral-100', 'shadow-lg', 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2', position === 'popper' && 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1', className),
35754
+ className: clsx('relative z-[100001] max-h-96 min-w-[8rem] overflow-hidden rounded-md border border-mw-neutral-200 dark:border-mw-neutral-700', 'bg-white dark:bg-mw-neutral-800 text-mw-neutral-900 dark:text-mw-neutral-100', 'shadow-lg', 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2', position === 'popper' && 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1', className),
35751
35755
  position: position
35752
35756
  }, props, {
35753
35757
  children: [require$$1.jsx(SelectScrollUpButton, {}), require$$1.jsx(Viewport, {
@@ -37769,7 +37773,7 @@ function formatFileSize(bytes) {
37769
37773
  }
37770
37774
  function getFileIcon$1(file) {
37771
37775
  if (file.type.startsWith('image/')) {
37772
- return require$$1.jsx(Image, {
37776
+ return require$$1.jsx(Image$1, {
37773
37777
  className: "w-4 h-4"
37774
37778
  });
37775
37779
  }
@@ -39988,7 +39992,7 @@ function RichTextEditor(_ref2) {
39988
39992
  }), require$$1.jsx(ToolbarButton, {
39989
39993
  onClick: formatCommands.image,
39990
39994
  title: "Insert Image",
39991
- children: require$$1.jsx(Image, {
39995
+ children: require$$1.jsx(Image$1, {
39992
39996
  className: "w-4 h-4"
39993
39997
  })
39994
39998
  })]
@@ -42502,7 +42506,7 @@ var emptyStateIcons = {
42502
42506
  folder: require$$1.jsx(FolderOpen, {
42503
42507
  className: "w-12 h-12 text-mw-neutral-400"
42504
42508
  }),
42505
- image: require$$1.jsx(Image, {
42509
+ image: require$$1.jsx(Image$1, {
42506
42510
  className: "w-12 h-12 text-mw-neutral-400"
42507
42511
  }),
42508
42512
  document: require$$1.jsx(FileText, {
@@ -45793,6 +45797,101 @@ function SheetDescription(_a) {
45793
45797
  }));
45794
45798
  }
45795
45799
 
45800
+ var variantConfig = {
45801
+ destructive: {
45802
+ icon: Trash2,
45803
+ iconClass: "text-red-500",
45804
+ bgClass: "bg-red-50 dark:bg-red-950/30",
45805
+ buttonClass: "bg-red-600 hover:bg-red-700 text-white border-transparent"
45806
+ },
45807
+ warning: {
45808
+ icon: TriangleAlert,
45809
+ iconClass: "text-amber-500",
45810
+ bgClass: "bg-amber-50 dark:bg-amber-950/30",
45811
+ buttonClass: "bg-amber-500 hover:bg-amber-600 text-white border-transparent"
45812
+ },
45813
+ "default": {
45814
+ icon: Info,
45815
+ iconClass: "text-mw-primary-500",
45816
+ bgClass: "bg-mw-primary-50 dark:bg-mw-primary-950/30",
45817
+ buttonClass: undefined // uses Button variant="primary"
45818
+ }
45819
+ };
45820
+ function ConfirmSheet(_ref) {
45821
+ var open = _ref.open,
45822
+ onOpenChange = _ref.onOpenChange,
45823
+ title = _ref.title,
45824
+ description = _ref.description,
45825
+ children = _ref.children,
45826
+ _ref$confirmLabel = _ref.confirmLabel,
45827
+ confirmLabel = _ref$confirmLabel === void 0 ? "Confirm" : _ref$confirmLabel,
45828
+ _ref$cancelLabel = _ref.cancelLabel,
45829
+ cancelLabel = _ref$cancelLabel === void 0 ? "Cancel" : _ref$cancelLabel,
45830
+ _ref$variant = _ref.variant,
45831
+ variant = _ref$variant === void 0 ? "default" : _ref$variant,
45832
+ _ref$isLoading = _ref.isLoading,
45833
+ isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
45834
+ onConfirm = _ref.onConfirm,
45835
+ onCancel = _ref.onCancel;
45836
+ var config = variantConfig[variant];
45837
+ var Icon = config.icon;
45838
+ var handleCancel = function handleCancel() {
45839
+ if (onCancel) {
45840
+ onCancel();
45841
+ } else {
45842
+ onOpenChange(false);
45843
+ }
45844
+ };
45845
+ return require$$1.jsx(Sheet, {
45846
+ open: open,
45847
+ onOpenChange: onOpenChange,
45848
+ children: require$$1.jsxs(SheetContent, {
45849
+ side: "right",
45850
+ size: "sm",
45851
+ className: "flex flex-col p-0",
45852
+ children: [require$$1.jsx(SheetHeader, {
45853
+ className: "px-6 py-5 border-b border-mw-neutral-200 dark:border-mw-neutral-700 flex-shrink-0",
45854
+ children: require$$1.jsx(SheetTitle, {
45855
+ children: title
45856
+ })
45857
+ }), require$$1.jsxs("div", {
45858
+ className: "flex-1 overflow-auto min-h-0 px-6 py-5 space-y-4",
45859
+ children: [require$$1.jsxs("div", {
45860
+ className: clsx("flex items-start gap-3 rounded-lg p-4", config.bgClass),
45861
+ children: [require$$1.jsx(Icon, {
45862
+ className: clsx("h-5 w-5 mt-0.5 flex-shrink-0", config.iconClass)
45863
+ }), description && require$$1.jsx("div", {
45864
+ className: "text-sm text-mw-neutral-700 dark:text-mw-neutral-300",
45865
+ children: description
45866
+ })]
45867
+ }), children && require$$1.jsx("div", {
45868
+ className: "text-sm text-mw-neutral-600 dark:text-mw-neutral-400",
45869
+ children: children
45870
+ })]
45871
+ }), require$$1.jsxs(SheetFooter, {
45872
+ className: "flex-shrink-0 border-t border-mw-neutral-200 dark:border-mw-neutral-700 px-6 py-4",
45873
+ children: [require$$1.jsx(Button, {
45874
+ variant: "outline",
45875
+ onClick: handleCancel,
45876
+ disabled: isLoading,
45877
+ children: cancelLabel
45878
+ }), variant === "default" ? require$$1.jsx(Button, {
45879
+ variant: "primary",
45880
+ onClick: onConfirm,
45881
+ disabled: isLoading,
45882
+ children: isLoading ? "Loading..." : confirmLabel
45883
+ }) : require$$1.jsx("button", {
45884
+ onClick: onConfirm,
45885
+ disabled: isLoading,
45886
+ 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),
45887
+ children: isLoading ? "Loading..." : confirmLabel
45888
+ })]
45889
+ })]
45890
+ })
45891
+ });
45892
+ }
45893
+ ConfirmSheet.displayName = "ConfirmSheet";
45894
+
45796
45895
  var PopoverContext = /*#__PURE__*/React.createContext(null);
45797
45896
  function Popover(_ref) {
45798
45897
  var _ref$open = _ref.open,
@@ -48323,6 +48422,24 @@ function ThumbnailGallery(_ref2) {
48323
48422
  });
48324
48423
  }
48325
48424
 
48425
+ /**
48426
+ * Design system Image component.
48427
+ * - Wraps native <img> so alt is a required prop (accessibility enforcement)
48428
+ * - Defaults to loading="lazy" for performance
48429
+ * - Use this instead of native <img> anywhere in the application
48430
+ */
48431
+ function Image(_a) {
48432
+ var alt = _a.alt,
48433
+ _a$loading = _a.loading,
48434
+ loading = _a$loading === void 0 ? 'lazy' : _a$loading,
48435
+ props = __rest$1(_a, ["alt", "loading"]);
48436
+ return require$$1.jsx("img", Object.assign({
48437
+ alt: alt,
48438
+ loading: loading
48439
+ }, props));
48440
+ }
48441
+ Image.displayName = 'Image';
48442
+
48326
48443
  function cn$3() {
48327
48444
  for (var _len = arguments.length, classes = new Array(_len), _key = 0; _key < _len; _key++) {
48328
48445
  classes[_key] = arguments[_key];
@@ -48428,7 +48545,7 @@ function useDragDrop(_ref) {
48428
48545
  function getFileIcon(file) {
48429
48546
  var type = file.type;
48430
48547
  var name = file.name.toLowerCase();
48431
- if (type.startsWith('image/')) return require$$1.jsx(Image, {
48548
+ if (type.startsWith('image/')) return require$$1.jsx(Image$1, {
48432
48549
  className: "w-6 h-6"
48433
48550
  });
48434
48551
  if (type.startsWith('video/')) return require$$1.jsx(Video, {
@@ -49213,7 +49330,7 @@ function PageHeader(_a) {
49213
49330
  props = __rest$1(_a, ["title", "description", "subtitle", "titleKey", "descriptionKey", "leftAction", "actions", "className"]);
49214
49331
  var desc = description !== null && description !== void 0 ? description : subtitle;
49215
49332
  var headerId = "page-header-".concat(title.toLowerCase().trim().split(/\s+/).join('-'));
49216
- var baseClass = 'bg-white flex flex-col justify-start items-start gap-4 border-b border-container-border pt-4 pb-3 dark:bg-mw-neutral-900 dark:border-mw-neutral-800';
49333
+ var baseClass = 'bg-white flex flex-col justify-start items-start gap-4 border-b border-t border-container-border pt-4 pb-3 dark:bg-mw-neutral-900 dark:border-mw-neutral-800';
49217
49334
  var combinedClass = className ? "".concat(baseClass, " ").concat(className) : baseClass;
49218
49335
  return require$$1.jsx("div", Object.assign({
49219
49336
  id: headerId,
@@ -57090,6 +57207,7 @@ exports.Command = Command;
57090
57207
  exports.CommandGroup = CommandGroup;
57091
57208
  exports.CommandItem = CommandItem;
57092
57209
  exports.CommandSeparator = CommandSeparator;
57210
+ exports.ConfirmSheet = ConfirmSheet;
57093
57211
  exports.Container = Container;
57094
57212
  exports.CounterAnimation = CounterAnimation;
57095
57213
  exports.DataGrid = DataGrid;
@@ -57140,6 +57258,7 @@ exports.GridContainer = GridContainer;
57140
57258
  exports.HStack = HStack;
57141
57259
  exports.Heading = Heading;
57142
57260
  exports.Icon = Icon$2;
57261
+ exports.Image = Image;
57143
57262
  exports.ImageCarousel = ImageCarousel;
57144
57263
  exports.ImageThumbnail = ImageThumbnail;
57145
57264
  exports.InfoIcon = InfoIcon;