@moontra/moonui 6.14.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.mjs CHANGED
@@ -195,18 +195,20 @@ var Alert = React12.forwardRef(
195
195
  }
196
196
  );
197
197
  Alert.displayName = "Alert";
198
- var AlertTitle = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
199
- "h5",
200
- {
201
- ref,
202
- className: cn(
203
- "moonui-theme",
204
- "font-semibold leading-tight tracking-tight mb-1",
205
- className
206
- ),
207
- ...props
208
- }
209
- ));
198
+ var AlertTitle = React12.forwardRef(
199
+ ({ className, as: Comp = "div", ...props }, ref) => /* @__PURE__ */ jsx(
200
+ Comp,
201
+ {
202
+ ref,
203
+ className: cn(
204
+ "moonui-theme",
205
+ "font-semibold leading-tight tracking-tight mb-1",
206
+ className
207
+ ),
208
+ ...props
209
+ }
210
+ )
211
+ );
210
212
  AlertTitle.displayName = "AlertTitle";
211
213
  var AlertDescription = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
212
214
  "div",
@@ -1147,14 +1149,16 @@ var CardHeader = React12.forwardRef(({ className, ...props }, ref) => {
1147
1149
  );
1148
1150
  });
1149
1151
  CardHeader.displayName = "CardHeader";
1150
- var CardTitle = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1151
- "h3",
1152
- {
1153
- ref,
1154
- className: cn("moonui-theme", "text-lg font-semibold leading-none tracking-tight", className),
1155
- ...props
1156
- }
1157
- ));
1152
+ var CardTitle = React12.forwardRef(
1153
+ ({ className, as: Comp = "h3", ...props }, ref) => /* @__PURE__ */ jsx(
1154
+ Comp,
1155
+ {
1156
+ ref,
1157
+ className: cn("moonui-theme", "text-lg font-semibold leading-none tracking-tight", className),
1158
+ ...props
1159
+ }
1160
+ )
1161
+ );
1158
1162
  CardTitle.displayName = "CardTitle";
1159
1163
  var CardDescription = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1160
1164
  "p",
@@ -4244,20 +4248,23 @@ var DatePicker = React12.forwardRef(function DatePicker2({
4244
4248
  };
4245
4249
  const displayValue = internalDate && isValid(internalDate) ? format(internalDate, formatString) : null;
4246
4250
  const iconElement = icon || /* @__PURE__ */ jsx(Calendar$1, { className: "h-4 w-4" });
4247
- return /* @__PURE__ */ jsx("div", { ref, className: "moonui-theme", children: /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
4248
- /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
4249
- Button,
4250
- {
4251
- variant: variant === "ghost" ? "ghost" : "outline",
4252
- className: cn(
4253
- datePickerVariants({ variant, size, state }),
4254
- !displayValue && "text-muted-foreground",
4255
- className
4256
- ),
4257
- disabled: disabled || readOnly,
4258
- ...props,
4259
- children: [
4260
- /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: /* @__PURE__ */ jsxs(
4251
+ return /* @__PURE__ */ jsx("div", { ref, className: "moonui-theme", children: /* @__PURE__ */ jsxs("div", { className: "relative", children: [
4252
+ /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
4253
+ /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
4254
+ Button,
4255
+ {
4256
+ variant: variant === "ghost" ? "ghost" : "outline",
4257
+ className: cn(
4258
+ datePickerVariants({ variant, size, state }),
4259
+ !displayValue && "text-muted-foreground",
4260
+ // #345: temizle butonu artık MUTLAK konumlu bir kardeş — uzun tarih
4261
+ // metninin altına girmemesi için sağda yer ayrılıyor.
4262
+ allowClear && displayValue && !readOnly && !disabled && "pr-9",
4263
+ className
4264
+ ),
4265
+ disabled: disabled || readOnly,
4266
+ ...props,
4267
+ children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: /* @__PURE__ */ jsxs(
4261
4268
  motion.div,
4262
4269
  {
4263
4270
  initial: { opacity: 0, y: -2 },
@@ -4272,87 +4279,74 @@ var DatePicker = React12.forwardRef(function DatePicker2({
4272
4279
  ]
4273
4280
  },
4274
4281
  displayValue || "placeholder"
4275
- ) }),
4276
- allowClear && displayValue && !readOnly && !disabled && /* @__PURE__ */ jsxs(
4282
+ ) })
4283
+ }
4284
+ ) }),
4285
+ /* @__PURE__ */ jsx(
4286
+ PopoverContent,
4287
+ {
4288
+ className: "w-[360px] p-0 shadow-2xl rounded-2xl border border-border bg-background/95 backdrop-blur-sm !z-[9999]",
4289
+ align: "start",
4290
+ sideOffset: 12,
4291
+ children: /* @__PURE__ */ jsxs(
4277
4292
  motion.div,
4278
4293
  {
4279
- initial: { opacity: 0, scale: 0.8 },
4280
- animate: { opacity: 1, scale: 1 },
4281
- exit: { opacity: 0, scale: 0.8 },
4282
- whileHover: { scale: 1.1 },
4283
- whileTap: { scale: 0.9 },
4284
- className: "ml-2 h-4 w-4 shrink-0 opacity-50 hover:opacity-100 transition-opacity cursor-pointer",
4285
- onClick: handleClear,
4286
- role: "button",
4287
- tabIndex: 0,
4288
- onKeyDown: (e) => {
4289
- if (e.key === "Enter" || e.key === " ") {
4290
- e.preventDefault();
4291
- handleClear(e);
4292
- }
4293
- },
4294
+ ...pageTransitions2,
4295
+ className: "rounded-2xl bg-background overflow-hidden",
4294
4296
  children: [
4295
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Clear date" }),
4296
4297
  /* @__PURE__ */ jsx(
4297
- "svg",
4298
+ Calendar,
4298
4299
  {
4299
- width: "15",
4300
- height: "15",
4301
- viewBox: "0 0 15 15",
4302
- fill: "none",
4303
- xmlns: "http://www.w3.org/2000/svg",
4304
- children: /* @__PURE__ */ jsx(
4305
- "path",
4306
- {
4307
- 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",
4308
- fill: "currentColor",
4309
- fillRule: "evenodd",
4310
- clipRule: "evenodd"
4311
- }
4312
- )
4300
+ mode: "single",
4301
+ selected: internalDate,
4302
+ onSelect: handleSelect,
4303
+ disabled: isDateDisabled,
4304
+ showOutsideDays: false,
4305
+ className: cn("rounded-2xl", calendarProps?.className),
4306
+ ...calendarProps
4313
4307
  }
4314
- )
4308
+ ),
4309
+ showTodayButton && /* @__PURE__ */ jsx("div", { className: "border-t px-4 py-3", children: /* @__PURE__ */ jsx(
4310
+ Button,
4311
+ {
4312
+ variant: "ghost",
4313
+ size: "sm",
4314
+ onClick: handleToday,
4315
+ className: "w-full justify-center hover:bg-accent hover:text-accent-foreground transition-all duration-200",
4316
+ children: "Today"
4317
+ }
4318
+ ) })
4315
4319
  ]
4316
4320
  }
4317
4321
  )
4318
- ]
4319
- }
4320
- ) }),
4321
- /* @__PURE__ */ jsx(
4322
- PopoverContent,
4322
+ }
4323
+ )
4324
+ ] }),
4325
+ allowClear && displayValue && !readOnly && !disabled && /* @__PURE__ */ jsx(
4326
+ "button",
4323
4327
  {
4324
- className: "w-[360px] p-0 shadow-2xl rounded-2xl border border-border bg-background/95 backdrop-blur-sm !z-[9999]",
4325
- align: "start",
4326
- sideOffset: 12,
4327
- children: /* @__PURE__ */ jsxs(
4328
- motion.div,
4328
+ type: "button",
4329
+ onClick: handleClear,
4330
+ "aria-label": "Clear date",
4331
+ className: "absolute right-3 top-1/2 -translate-y-1/2 h-4 w-4 shrink-0 opacity-50 hover:opacity-100 transition-opacity",
4332
+ children: /* @__PURE__ */ jsx(
4333
+ "svg",
4329
4334
  {
4330
- ...pageTransitions2,
4331
- className: "rounded-2xl bg-background overflow-hidden",
4332
- children: [
4333
- /* @__PURE__ */ jsx(
4334
- Calendar,
4335
- {
4336
- mode: "single",
4337
- selected: internalDate,
4338
- onSelect: handleSelect,
4339
- disabled: isDateDisabled,
4340
- showOutsideDays: false,
4341
- className: cn("rounded-2xl", calendarProps?.className),
4342
- ...calendarProps
4343
- }
4344
- ),
4345
- showTodayButton && /* @__PURE__ */ jsx("div", { className: "border-t px-4 py-3", children: /* @__PURE__ */ jsx(
4346
- Button,
4347
- {
4348
- variant: "ghost",
4349
- size: "sm",
4350
- onClick: handleToday,
4351
- className: "w-full justify-center hover:bg-accent hover:text-accent-foreground transition-all duration-200",
4352
- children: "Today"
4353
- }
4354
- ) })
4355
- ]
4335
+ width: "15",
4336
+ height: "15",
4337
+ viewBox: "0 0 15 15",
4338
+ fill: "none",
4339
+ "aria-hidden": "true",
4340
+ xmlns: "http://www.w3.org/2000/svg",
4341
+ children: /* @__PURE__ */ 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
+ )
4356
4350
  }
4357
4351
  )
4358
4352
  }