@moontra/moonui 6.13.0 → 6.15.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.js CHANGED
@@ -233,18 +233,20 @@ var Alert = React12__namespace.forwardRef(
233
233
  }
234
234
  );
235
235
  Alert.displayName = "Alert";
236
- var AlertTitle = React12__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
237
- "h5",
238
- {
239
- ref,
240
- className: cn(
241
- "moonui-theme",
242
- "font-semibold leading-tight tracking-tight mb-1",
243
- className
244
- ),
245
- ...props
246
- }
247
- ));
236
+ var AlertTitle = React12__namespace.forwardRef(
237
+ ({ className, as: Comp = "div", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
238
+ Comp,
239
+ {
240
+ ref,
241
+ className: cn(
242
+ "moonui-theme",
243
+ "font-semibold leading-tight tracking-tight mb-1",
244
+ className
245
+ ),
246
+ ...props
247
+ }
248
+ )
249
+ );
248
250
  AlertTitle.displayName = "AlertTitle";
249
251
  var AlertDescription = React12__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
250
252
  "div",
@@ -347,10 +349,11 @@ var Avatar = React12__namespace.forwardRef(({ className, size, radius, variant,
347
349
  }
348
350
  ));
349
351
  Avatar.displayName = AvatarPrimitive__namespace.Root.displayName;
350
- var AvatarImage = React12__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
352
+ var AvatarImage = React12__namespace.forwardRef(({ className, alt = "", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
351
353
  AvatarPrimitive__namespace.Image,
352
354
  {
353
355
  ref,
356
+ alt,
354
357
  className: cn("moonui-theme", "aspect-square h-full w-full", className),
355
358
  ...props
356
359
  }
@@ -1184,14 +1187,16 @@ var CardHeader = React12__namespace.forwardRef(({ className, ...props }, ref) =>
1184
1187
  );
1185
1188
  });
1186
1189
  CardHeader.displayName = "CardHeader";
1187
- var CardTitle = React12__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1188
- "h3",
1189
- {
1190
- ref,
1191
- className: cn("moonui-theme", "text-lg font-semibold leading-none tracking-tight", className),
1192
- ...props
1193
- }
1194
- ));
1190
+ var CardTitle = React12__namespace.forwardRef(
1191
+ ({ className, as: Comp = "h3", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1192
+ Comp,
1193
+ {
1194
+ ref,
1195
+ className: cn("moonui-theme", "text-lg font-semibold leading-none tracking-tight", className),
1196
+ ...props
1197
+ }
1198
+ )
1199
+ );
1195
1200
  CardTitle.displayName = "CardTitle";
1196
1201
  var CardDescription = React12__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1197
1202
  "p",
@@ -4281,20 +4286,23 @@ var DatePicker = React12__namespace.forwardRef(function DatePicker2({
4281
4286
  };
4282
4287
  const displayValue = internalDate && dateFns.isValid(internalDate) ? dateFns.format(internalDate, formatString) : null;
4283
4288
  const iconElement = icon || /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Calendar, { className: "h-4 w-4" });
4284
- return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: "moonui-theme", children: /* @__PURE__ */ jsxRuntime.jsxs(Popover, { open, onOpenChange: setOpen, children: [
4285
- /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
4286
- Button,
4287
- {
4288
- variant: variant === "ghost" ? "ghost" : "outline",
4289
- className: cn(
4290
- datePickerVariants({ variant, size, state }),
4291
- !displayValue && "text-muted-foreground",
4292
- className
4293
- ),
4294
- disabled: disabled || readOnly,
4295
- ...props,
4296
- children: [
4297
- /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { mode: "wait", children: /* @__PURE__ */ jsxRuntime.jsxs(
4289
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: "moonui-theme", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
4290
+ /* @__PURE__ */ jsxRuntime.jsxs(Popover, { open, onOpenChange: setOpen, children: [
4291
+ /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
4292
+ Button,
4293
+ {
4294
+ variant: variant === "ghost" ? "ghost" : "outline",
4295
+ className: cn(
4296
+ datePickerVariants({ variant, size, state }),
4297
+ !displayValue && "text-muted-foreground",
4298
+ // #345: temizle butonu artık MUTLAK konumlu bir kardeş — uzun tarih
4299
+ // metninin altına girmemesi için sağda yer ayrılıyor.
4300
+ allowClear && displayValue && !readOnly && !disabled && "pr-9",
4301
+ className
4302
+ ),
4303
+ disabled: disabled || readOnly,
4304
+ ...props,
4305
+ children: /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { mode: "wait", children: /* @__PURE__ */ jsxRuntime.jsxs(
4298
4306
  framerMotion.motion.div,
4299
4307
  {
4300
4308
  initial: { opacity: 0, y: -2 },
@@ -4309,87 +4317,74 @@ var DatePicker = React12__namespace.forwardRef(function DatePicker2({
4309
4317
  ]
4310
4318
  },
4311
4319
  displayValue || "placeholder"
4312
- ) }),
4313
- allowClear && displayValue && !readOnly && !disabled && /* @__PURE__ */ jsxRuntime.jsxs(
4320
+ ) })
4321
+ }
4322
+ ) }),
4323
+ /* @__PURE__ */ jsxRuntime.jsx(
4324
+ PopoverContent,
4325
+ {
4326
+ className: "w-[360px] p-0 shadow-2xl rounded-2xl border border-border bg-background/95 backdrop-blur-sm !z-[9999]",
4327
+ align: "start",
4328
+ sideOffset: 12,
4329
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
4314
4330
  framerMotion.motion.div,
4315
4331
  {
4316
- initial: { opacity: 0, scale: 0.8 },
4317
- animate: { opacity: 1, scale: 1 },
4318
- exit: { opacity: 0, scale: 0.8 },
4319
- whileHover: { scale: 1.1 },
4320
- whileTap: { scale: 0.9 },
4321
- className: "ml-2 h-4 w-4 shrink-0 opacity-50 hover:opacity-100 transition-opacity cursor-pointer",
4322
- onClick: handleClear,
4323
- role: "button",
4324
- tabIndex: 0,
4325
- onKeyDown: (e) => {
4326
- if (e.key === "Enter" || e.key === " ") {
4327
- e.preventDefault();
4328
- handleClear(e);
4329
- }
4330
- },
4332
+ ...pageTransitions2,
4333
+ className: "rounded-2xl bg-background overflow-hidden",
4331
4334
  children: [
4332
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Clear date" }),
4333
4335
  /* @__PURE__ */ jsxRuntime.jsx(
4334
- "svg",
4336
+ Calendar,
4335
4337
  {
4336
- width: "15",
4337
- height: "15",
4338
- viewBox: "0 0 15 15",
4339
- fill: "none",
4340
- xmlns: "http://www.w3.org/2000/svg",
4341
- children: /* @__PURE__ */ jsxRuntime.jsx(
4342
- "path",
4343
- {
4344
- d: "M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",
4345
- fill: "currentColor",
4346
- fillRule: "evenodd",
4347
- clipRule: "evenodd"
4348
- }
4349
- )
4338
+ mode: "single",
4339
+ selected: internalDate,
4340
+ onSelect: handleSelect,
4341
+ disabled: isDateDisabled,
4342
+ showOutsideDays: false,
4343
+ className: cn("rounded-2xl", calendarProps?.className),
4344
+ ...calendarProps
4350
4345
  }
4351
- )
4346
+ ),
4347
+ showTodayButton && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t px-4 py-3", children: /* @__PURE__ */ jsxRuntime.jsx(
4348
+ Button,
4349
+ {
4350
+ variant: "ghost",
4351
+ size: "sm",
4352
+ onClick: handleToday,
4353
+ className: "w-full justify-center hover:bg-accent hover:text-accent-foreground transition-all duration-200",
4354
+ children: "Today"
4355
+ }
4356
+ ) })
4352
4357
  ]
4353
4358
  }
4354
4359
  )
4355
- ]
4356
- }
4357
- ) }),
4358
- /* @__PURE__ */ jsxRuntime.jsx(
4359
- PopoverContent,
4360
+ }
4361
+ )
4362
+ ] }),
4363
+ allowClear && displayValue && !readOnly && !disabled && /* @__PURE__ */ jsxRuntime.jsx(
4364
+ "button",
4360
4365
  {
4361
- className: "w-[360px] p-0 shadow-2xl rounded-2xl border border-border bg-background/95 backdrop-blur-sm !z-[9999]",
4362
- align: "start",
4363
- sideOffset: 12,
4364
- children: /* @__PURE__ */ jsxRuntime.jsxs(
4365
- framerMotion.motion.div,
4366
+ type: "button",
4367
+ onClick: handleClear,
4368
+ "aria-label": "Clear date",
4369
+ className: "absolute right-3 top-1/2 -translate-y-1/2 h-4 w-4 shrink-0 opacity-50 hover:opacity-100 transition-opacity",
4370
+ children: /* @__PURE__ */ jsxRuntime.jsx(
4371
+ "svg",
4366
4372
  {
4367
- ...pageTransitions2,
4368
- className: "rounded-2xl bg-background overflow-hidden",
4369
- children: [
4370
- /* @__PURE__ */ jsxRuntime.jsx(
4371
- Calendar,
4372
- {
4373
- mode: "single",
4374
- selected: internalDate,
4375
- onSelect: handleSelect,
4376
- disabled: isDateDisabled,
4377
- showOutsideDays: false,
4378
- className: cn("rounded-2xl", calendarProps?.className),
4379
- ...calendarProps
4380
- }
4381
- ),
4382
- showTodayButton && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t px-4 py-3", children: /* @__PURE__ */ jsxRuntime.jsx(
4383
- Button,
4384
- {
4385
- variant: "ghost",
4386
- size: "sm",
4387
- onClick: handleToday,
4388
- className: "w-full justify-center hover:bg-accent hover:text-accent-foreground transition-all duration-200",
4389
- children: "Today"
4390
- }
4391
- ) })
4392
- ]
4373
+ width: "15",
4374
+ height: "15",
4375
+ viewBox: "0 0 15 15",
4376
+ fill: "none",
4377
+ "aria-hidden": "true",
4378
+ xmlns: "http://www.w3.org/2000/svg",
4379
+ children: /* @__PURE__ */ jsxRuntime.jsx(
4380
+ "path",
4381
+ {
4382
+ d: "M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",
4383
+ fill: "currentColor",
4384
+ fillRule: "evenodd",
4385
+ clipRule: "evenodd"
4386
+ }
4387
+ )
4393
4388
  }
4394
4389
  )
4395
4390
  }