@moontra/moonui 6.14.0 → 6.16.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/hooks/index.global.js +25 -1
- package/dist/hooks/index.global.js.map +1 -1
- package/dist/index.d.mts +38 -4
- package/dist/index.d.ts +38 -4
- package/dist/index.global.js +23 -23
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +133 -134
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +133 -134
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/ui/__tests__/alert.test.tsx +30 -3
- package/src/components/ui/__tests__/heading-level-policy.test.tsx +71 -0
- package/src/components/ui/__tests__/select-trigger-name.test.tsx +65 -0
- package/src/components/ui/alert.tsx +34 -14
- package/src/components/ui/card.tsx +26 -10
- package/src/components/ui/date-picker.tsx +36 -36
- package/src/components/ui/select.tsx +22 -3
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(
|
|
237
|
-
"
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
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",
|
|
@@ -1185,14 +1187,16 @@ var CardHeader = React12__namespace.forwardRef(({ className, ...props }, ref) =>
|
|
|
1185
1187
|
);
|
|
1186
1188
|
});
|
|
1187
1189
|
CardHeader.displayName = "CardHeader";
|
|
1188
|
-
var CardTitle = React12__namespace.forwardRef(
|
|
1189
|
-
"h3",
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
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
|
+
);
|
|
1196
1200
|
CardTitle.displayName = "CardTitle";
|
|
1197
1201
|
var CardDescription = React12__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1198
1202
|
"p",
|
|
@@ -4282,20 +4286,23 @@ var DatePicker = React12__namespace.forwardRef(function DatePicker2({
|
|
|
4282
4286
|
};
|
|
4283
4287
|
const displayValue = internalDate && dateFns.isValid(internalDate) ? dateFns.format(internalDate, formatString) : null;
|
|
4284
4288
|
const iconElement = icon || /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Calendar, { className: "h-4 w-4" });
|
|
4285
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: "moonui-theme", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4286
|
-
/* @__PURE__ */ jsxRuntime.
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
|
|
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(
|
|
4299
4306
|
framerMotion.motion.div,
|
|
4300
4307
|
{
|
|
4301
4308
|
initial: { opacity: 0, y: -2 },
|
|
@@ -4310,87 +4317,74 @@ var DatePicker = React12__namespace.forwardRef(function DatePicker2({
|
|
|
4310
4317
|
]
|
|
4311
4318
|
},
|
|
4312
4319
|
displayValue || "placeholder"
|
|
4313
|
-
) })
|
|
4314
|
-
|
|
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(
|
|
4315
4330
|
framerMotion.motion.div,
|
|
4316
4331
|
{
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
exit: { opacity: 0, scale: 0.8 },
|
|
4320
|
-
whileHover: { scale: 1.1 },
|
|
4321
|
-
whileTap: { scale: 0.9 },
|
|
4322
|
-
className: "ml-2 h-4 w-4 shrink-0 opacity-50 hover:opacity-100 transition-opacity cursor-pointer",
|
|
4323
|
-
onClick: handleClear,
|
|
4324
|
-
role: "button",
|
|
4325
|
-
tabIndex: 0,
|
|
4326
|
-
onKeyDown: (e) => {
|
|
4327
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
4328
|
-
e.preventDefault();
|
|
4329
|
-
handleClear(e);
|
|
4330
|
-
}
|
|
4331
|
-
},
|
|
4332
|
+
...pageTransitions2,
|
|
4333
|
+
className: "rounded-2xl bg-background overflow-hidden",
|
|
4332
4334
|
children: [
|
|
4333
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Clear date" }),
|
|
4334
4335
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4335
|
-
|
|
4336
|
+
Calendar,
|
|
4336
4337
|
{
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4344
|
-
{
|
|
4345
|
-
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",
|
|
4346
|
-
fill: "currentColor",
|
|
4347
|
-
fillRule: "evenodd",
|
|
4348
|
-
clipRule: "evenodd"
|
|
4349
|
-
}
|
|
4350
|
-
)
|
|
4338
|
+
mode: "single",
|
|
4339
|
+
selected: internalDate,
|
|
4340
|
+
onSelect: handleSelect,
|
|
4341
|
+
disabled: isDateDisabled,
|
|
4342
|
+
showOutsideDays: false,
|
|
4343
|
+
className: cn("rounded-2xl", calendarProps?.className),
|
|
4344
|
+
...calendarProps
|
|
4351
4345
|
}
|
|
4352
|
-
)
|
|
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
|
+
) })
|
|
4353
4357
|
]
|
|
4354
4358
|
}
|
|
4355
4359
|
)
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4360
|
-
|
|
4360
|
+
}
|
|
4361
|
+
)
|
|
4362
|
+
] }),
|
|
4363
|
+
allowClear && displayValue && !readOnly && !disabled && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4364
|
+
"button",
|
|
4361
4365
|
{
|
|
4362
|
-
|
|
4363
|
-
|
|
4364
|
-
|
|
4365
|
-
|
|
4366
|
-
|
|
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",
|
|
4367
4372
|
{
|
|
4368
|
-
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
showTodayButton && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t px-4 py-3", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4384
|
-
Button,
|
|
4385
|
-
{
|
|
4386
|
-
variant: "ghost",
|
|
4387
|
-
size: "sm",
|
|
4388
|
-
onClick: handleToday,
|
|
4389
|
-
className: "w-full justify-center hover:bg-accent hover:text-accent-foreground transition-all duration-200",
|
|
4390
|
-
children: "Today"
|
|
4391
|
-
}
|
|
4392
|
-
) })
|
|
4393
|
-
]
|
|
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
|
+
)
|
|
4394
4388
|
}
|
|
4395
4389
|
)
|
|
4396
4390
|
}
|
|
@@ -6093,36 +6087,41 @@ var selectTriggerVariants = classVarianceAuthority.cva(
|
|
|
6093
6087
|
}
|
|
6094
6088
|
}
|
|
6095
6089
|
);
|
|
6096
|
-
var SelectTrigger = React12__namespace.forwardRef(({ className, children, variant, size, error, success, loading, leftIcon, rightIcon, ...props }, ref) =>
|
|
6097
|
-
|
|
6098
|
-
|
|
6099
|
-
|
|
6100
|
-
|
|
6101
|
-
|
|
6102
|
-
|
|
6103
|
-
|
|
6104
|
-
|
|
6105
|
-
|
|
6106
|
-
|
|
6107
|
-
|
|
6108
|
-
|
|
6109
|
-
|
|
6110
|
-
|
|
6111
|
-
|
|
6112
|
-
|
|
6113
|
-
|
|
6114
|
-
|
|
6115
|
-
|
|
6116
|
-
|
|
6117
|
-
|
|
6118
|
-
|
|
6119
|
-
|
|
6120
|
-
|
|
6121
|
-
|
|
6122
|
-
|
|
6123
|
-
|
|
6124
|
-
|
|
6125
|
-
)
|
|
6090
|
+
var SelectTrigger = React12__namespace.forwardRef(({ className, children, variant, size, error, success, loading, leftIcon, rightIcon, ...props }, ref) => {
|
|
6091
|
+
const icerikId = React12__namespace.useId();
|
|
6092
|
+
const adVerilmis = props["aria-label"] != null || props["aria-labelledby"] != null;
|
|
6093
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6094
|
+
SelectPrimitive__namespace.Trigger,
|
|
6095
|
+
{
|
|
6096
|
+
ref,
|
|
6097
|
+
className: cn(
|
|
6098
|
+
selectTriggerVariants({
|
|
6099
|
+
variant,
|
|
6100
|
+
size,
|
|
6101
|
+
state: error ? "error" : success ? "success" : "none"
|
|
6102
|
+
}),
|
|
6103
|
+
className
|
|
6104
|
+
),
|
|
6105
|
+
...props,
|
|
6106
|
+
disabled: props.disabled || loading,
|
|
6107
|
+
"aria-invalid": error ? true : void 0,
|
|
6108
|
+
"data-error": error ? true : void 0,
|
|
6109
|
+
"data-success": success ? true : void 0,
|
|
6110
|
+
"data-loading": loading ? true : void 0,
|
|
6111
|
+
"aria-labelledby": adVerilmis ? props["aria-labelledby"] : icerikId,
|
|
6112
|
+
children: [
|
|
6113
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { id: icerikId, className: "flex items-center flex-1 gap-2", children: [
|
|
6114
|
+
leftIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex items-center justify-center text-muted-foreground", children: leftIcon }),
|
|
6115
|
+
loading ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
6116
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground" }),
|
|
6117
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Loading..." })
|
|
6118
|
+
] }) : children
|
|
6119
|
+
] }),
|
|
6120
|
+
!loading && /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Icon, { asChild: true, children: rightIcon ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "opacity-60", children: rightIcon }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "h-4 w-4 opacity-60 transition-transform duration-200 ease-out group-data-[state=open]:rotate-180" }) })
|
|
6121
|
+
]
|
|
6122
|
+
}
|
|
6123
|
+
);
|
|
6124
|
+
});
|
|
6126
6125
|
SelectTrigger.displayName = SelectPrimitive__namespace.Trigger.displayName;
|
|
6127
6126
|
var SelectScrollUpButton = React12__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
6128
6127
|
SelectPrimitive__namespace.ScrollUpButton,
|