@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.d.mts +52 -4
- package/dist/index.d.ts +52 -4
- package/dist/index.global.js +23 -23
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +100 -105
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +100 -105
- package/dist/index.mjs.map +1 -1
- package/dist/lib/theme.global.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ui/__tests__/alert.test.tsx +30 -3
- package/src/components/ui/__tests__/avatar-image-alt.test.tsx +54 -0
- package/src/components/ui/__tests__/heading-level-policy.test.tsx +71 -0
- package/src/components/ui/alert.tsx +34 -14
- package/src/components/ui/avatar.tsx +16 -1
- package/src/components/ui/card.tsx +26 -10
- package/src/components/ui/date-picker.tsx +36 -36
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(
|
|
199
|
-
"
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
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",
|
|
@@ -309,10 +311,11 @@ var Avatar = React12.forwardRef(({ className, size, radius, variant, ...props },
|
|
|
309
311
|
}
|
|
310
312
|
));
|
|
311
313
|
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
312
|
-
var AvatarImage = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
314
|
+
var AvatarImage = React12.forwardRef(({ className, alt = "", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
313
315
|
AvatarPrimitive.Image,
|
|
314
316
|
{
|
|
315
317
|
ref,
|
|
318
|
+
alt,
|
|
316
319
|
className: cn("moonui-theme", "aspect-square h-full w-full", className),
|
|
317
320
|
...props
|
|
318
321
|
}
|
|
@@ -1146,14 +1149,16 @@ var CardHeader = React12.forwardRef(({ className, ...props }, ref) => {
|
|
|
1146
1149
|
);
|
|
1147
1150
|
});
|
|
1148
1151
|
CardHeader.displayName = "CardHeader";
|
|
1149
|
-
var CardTitle = React12.forwardRef(
|
|
1150
|
-
"h3",
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
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
|
+
);
|
|
1157
1162
|
CardTitle.displayName = "CardTitle";
|
|
1158
1163
|
var CardDescription = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1159
1164
|
"p",
|
|
@@ -4243,20 +4248,23 @@ var DatePicker = React12.forwardRef(function DatePicker2({
|
|
|
4243
4248
|
};
|
|
4244
4249
|
const displayValue = internalDate && isValid(internalDate) ? format(internalDate, formatString) : null;
|
|
4245
4250
|
const iconElement = icon || /* @__PURE__ */ jsx(Calendar$1, { className: "h-4 w-4" });
|
|
4246
|
-
return /* @__PURE__ */ jsx("div", { ref, className: "moonui-theme", children: /* @__PURE__ */ jsxs(
|
|
4247
|
-
/* @__PURE__ */
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
|
|
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(
|
|
4260
4268
|
motion.div,
|
|
4261
4269
|
{
|
|
4262
4270
|
initial: { opacity: 0, y: -2 },
|
|
@@ -4271,87 +4279,74 @@ var DatePicker = React12.forwardRef(function DatePicker2({
|
|
|
4271
4279
|
]
|
|
4272
4280
|
},
|
|
4273
4281
|
displayValue || "placeholder"
|
|
4274
|
-
) })
|
|
4275
|
-
|
|
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(
|
|
4276
4292
|
motion.div,
|
|
4277
4293
|
{
|
|
4278
|
-
|
|
4279
|
-
|
|
4280
|
-
exit: { opacity: 0, scale: 0.8 },
|
|
4281
|
-
whileHover: { scale: 1.1 },
|
|
4282
|
-
whileTap: { scale: 0.9 },
|
|
4283
|
-
className: "ml-2 h-4 w-4 shrink-0 opacity-50 hover:opacity-100 transition-opacity cursor-pointer",
|
|
4284
|
-
onClick: handleClear,
|
|
4285
|
-
role: "button",
|
|
4286
|
-
tabIndex: 0,
|
|
4287
|
-
onKeyDown: (e) => {
|
|
4288
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
4289
|
-
e.preventDefault();
|
|
4290
|
-
handleClear(e);
|
|
4291
|
-
}
|
|
4292
|
-
},
|
|
4294
|
+
...pageTransitions2,
|
|
4295
|
+
className: "rounded-2xl bg-background overflow-hidden",
|
|
4293
4296
|
children: [
|
|
4294
|
-
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Clear date" }),
|
|
4295
4297
|
/* @__PURE__ */ jsx(
|
|
4296
|
-
|
|
4298
|
+
Calendar,
|
|
4297
4299
|
{
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
{
|
|
4306
|
-
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",
|
|
4307
|
-
fill: "currentColor",
|
|
4308
|
-
fillRule: "evenodd",
|
|
4309
|
-
clipRule: "evenodd"
|
|
4310
|
-
}
|
|
4311
|
-
)
|
|
4300
|
+
mode: "single",
|
|
4301
|
+
selected: internalDate,
|
|
4302
|
+
onSelect: handleSelect,
|
|
4303
|
+
disabled: isDateDisabled,
|
|
4304
|
+
showOutsideDays: false,
|
|
4305
|
+
className: cn("rounded-2xl", calendarProps?.className),
|
|
4306
|
+
...calendarProps
|
|
4312
4307
|
}
|
|
4313
|
-
)
|
|
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
|
+
) })
|
|
4314
4319
|
]
|
|
4315
4320
|
}
|
|
4316
4321
|
)
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
/* @__PURE__ */ jsx(
|
|
4321
|
-
|
|
4322
|
+
}
|
|
4323
|
+
)
|
|
4324
|
+
] }),
|
|
4325
|
+
allowClear && displayValue && !readOnly && !disabled && /* @__PURE__ */ jsx(
|
|
4326
|
+
"button",
|
|
4322
4327
|
{
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
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",
|
|
4328
4334
|
{
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4344
|
-
showTodayButton && /* @__PURE__ */ jsx("div", { className: "border-t px-4 py-3", children: /* @__PURE__ */ jsx(
|
|
4345
|
-
Button,
|
|
4346
|
-
{
|
|
4347
|
-
variant: "ghost",
|
|
4348
|
-
size: "sm",
|
|
4349
|
-
onClick: handleToday,
|
|
4350
|
-
className: "w-full justify-center hover:bg-accent hover:text-accent-foreground transition-all duration-200",
|
|
4351
|
-
children: "Today"
|
|
4352
|
-
}
|
|
4353
|
-
) })
|
|
4354
|
-
]
|
|
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
|
+
)
|
|
4355
4350
|
}
|
|
4356
4351
|
)
|
|
4357
4352
|
}
|