@humu-tech/ui 0.1.24 → 0.1.26
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 +40 -22
- package/dist/index.mjs +40 -22
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1648,6 +1648,16 @@ var import_react18 = require("react");
|
|
|
1648
1648
|
var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"));
|
|
1649
1649
|
var import_react19 = require("@phosphor-icons/react");
|
|
1650
1650
|
|
|
1651
|
+
// src/lib/keepOpenOnToast.ts
|
|
1652
|
+
function keepOpenOnToast(onInteractOutside) {
|
|
1653
|
+
return (event) => {
|
|
1654
|
+
onInteractOutside?.(event);
|
|
1655
|
+
if (event.target instanceof Element && event.target.closest("[data-sonner-toaster]")) {
|
|
1656
|
+
event.preventDefault();
|
|
1657
|
+
}
|
|
1658
|
+
};
|
|
1659
|
+
}
|
|
1660
|
+
|
|
1651
1661
|
// src/primitives/Dialog/Dialog.styles.ts
|
|
1652
1662
|
var import_class_variance_authority7 = require("class-variance-authority");
|
|
1653
1663
|
var dialogContentStyles = (0, import_class_variance_authority7.cva)(
|
|
@@ -1675,28 +1685,31 @@ var Trigger4 = (0, import_react18.forwardRef)((props, ref) => /* @__PURE__ */ (0
|
|
|
1675
1685
|
Trigger4.displayName = "Dialog.Trigger";
|
|
1676
1686
|
var Close4 = (0, import_react18.forwardRef)((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(DialogPrimitive.Close, { ref, ...props }));
|
|
1677
1687
|
Close4.displayName = "Dialog.Close";
|
|
1678
|
-
var Content4 = (0, import_react18.forwardRef)(
|
|
1679
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1688
|
+
var Content4 = (0, import_react18.forwardRef)(
|
|
1689
|
+
({ size, hideCloseButton, className, children, onInteractOutside, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(DialogPrimitive.Portal, { children: [
|
|
1690
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(DialogPrimitive.Overlay, { className: "bg-v2-canvas/80 fixed inset-0 z-50 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 motion-reduce:animate-none" }),
|
|
1691
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
1692
|
+
DialogPrimitive.Content,
|
|
1693
|
+
{
|
|
1694
|
+
ref,
|
|
1695
|
+
className: cn(dialogContentStyles({ size }), className),
|
|
1696
|
+
onInteractOutside: keepOpenOnToast(onInteractOutside),
|
|
1697
|
+
...props,
|
|
1698
|
+
children: [
|
|
1699
|
+
children,
|
|
1700
|
+
!hideCloseButton && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1701
|
+
DialogPrimitive.Close,
|
|
1702
|
+
{
|
|
1703
|
+
"aria-label": "Fechar",
|
|
1704
|
+
className: "absolute right-3 top-3 inline-flex size-8 items-center justify-center rounded-v2-md text-v2-fg-subtle opacity-70 transition-opacity hover:bg-v2-raised hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-v2-focus-ring/30 disabled:pointer-events-none motion-reduce:transition-none",
|
|
1705
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react19.X, { size: 16, weight: "bold", "aria-hidden": "true" })
|
|
1706
|
+
}
|
|
1707
|
+
)
|
|
1708
|
+
]
|
|
1709
|
+
}
|
|
1710
|
+
)
|
|
1711
|
+
] })
|
|
1712
|
+
);
|
|
1700
1713
|
Content4.displayName = "Dialog.Content";
|
|
1701
1714
|
var Header2 = (0, import_react18.forwardRef)(
|
|
1702
1715
|
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
@@ -2615,6 +2628,7 @@ var Content6 = (0, import_react26.forwardRef)(
|
|
|
2615
2628
|
hideCloseButton,
|
|
2616
2629
|
className,
|
|
2617
2630
|
children,
|
|
2631
|
+
onInteractOutside,
|
|
2618
2632
|
...props
|
|
2619
2633
|
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(DialogPrimitive2.Portal, { children: [
|
|
2620
2634
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DialogPrimitive2.Overlay, { className: "bg-v2-canvas/80 fixed inset-0 z-50 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 motion-reduce:animate-none" }),
|
|
@@ -2623,6 +2637,7 @@ var Content6 = (0, import_react26.forwardRef)(
|
|
|
2623
2637
|
{
|
|
2624
2638
|
ref,
|
|
2625
2639
|
className: cn(drawerContentStyles({ side, size }), className),
|
|
2640
|
+
onInteractOutside: keepOpenOnToast(onInteractOutside),
|
|
2626
2641
|
...props,
|
|
2627
2642
|
children: [
|
|
2628
2643
|
children,
|
|
@@ -3134,6 +3149,7 @@ var FileUpload = (0, import_react34.forwardRef)(
|
|
|
3134
3149
|
role: "button",
|
|
3135
3150
|
tabIndex: disabled ? -1 : 0,
|
|
3136
3151
|
"aria-disabled": disabled || void 0,
|
|
3152
|
+
"data-invalid": displayError ? "true" : void 0,
|
|
3137
3153
|
onClick: () => !disabled && inputRef.current?.click(),
|
|
3138
3154
|
onKeyDown: (e) => {
|
|
3139
3155
|
if ((e.key === "Enter" || e.key === " ") && !disabled) {
|
|
@@ -3191,6 +3207,7 @@ var FileUpload = (0, import_react34.forwardRef)(
|
|
|
3191
3207
|
accept,
|
|
3192
3208
|
multiple,
|
|
3193
3209
|
disabled,
|
|
3210
|
+
"aria-invalid": displayError ? true : void 0,
|
|
3194
3211
|
className: "hidden",
|
|
3195
3212
|
onChange: (e) => handleFiles(e.target.files)
|
|
3196
3213
|
}
|
|
@@ -4336,6 +4353,7 @@ var OtpInput = (0, import_react50.forwardRef)(
|
|
|
4336
4353
|
onChange,
|
|
4337
4354
|
maxLength: length,
|
|
4338
4355
|
pattern: import_input_otp.REGEXP_ONLY_DIGITS,
|
|
4356
|
+
"aria-invalid": error ? true : void 0,
|
|
4339
4357
|
containerClassName: cn(
|
|
4340
4358
|
"flex items-center gap-2 overflow-hidden p-1 has-[:disabled]:opacity-50",
|
|
4341
4359
|
className
|
package/dist/index.mjs
CHANGED
|
@@ -1526,6 +1526,16 @@ import {
|
|
|
1526
1526
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
1527
1527
|
import { X as X2 } from "@phosphor-icons/react";
|
|
1528
1528
|
|
|
1529
|
+
// src/lib/keepOpenOnToast.ts
|
|
1530
|
+
function keepOpenOnToast(onInteractOutside) {
|
|
1531
|
+
return (event) => {
|
|
1532
|
+
onInteractOutside?.(event);
|
|
1533
|
+
if (event.target instanceof Element && event.target.closest("[data-sonner-toaster]")) {
|
|
1534
|
+
event.preventDefault();
|
|
1535
|
+
}
|
|
1536
|
+
};
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1529
1539
|
// src/primitives/Dialog/Dialog.styles.ts
|
|
1530
1540
|
import { cva as cva7 } from "class-variance-authority";
|
|
1531
1541
|
var dialogContentStyles = cva7(
|
|
@@ -1553,28 +1563,31 @@ var Trigger4 = forwardRef13((props, ref) => /* @__PURE__ */ jsx18(DialogPrimitiv
|
|
|
1553
1563
|
Trigger4.displayName = "Dialog.Trigger";
|
|
1554
1564
|
var Close4 = forwardRef13((props, ref) => /* @__PURE__ */ jsx18(DialogPrimitive.Close, { ref, ...props }));
|
|
1555
1565
|
Close4.displayName = "Dialog.Close";
|
|
1556
|
-
var Content4 = forwardRef13(
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1566
|
+
var Content4 = forwardRef13(
|
|
1567
|
+
({ size, hideCloseButton, className, children, onInteractOutside, ...props }, ref) => /* @__PURE__ */ jsxs10(DialogPrimitive.Portal, { children: [
|
|
1568
|
+
/* @__PURE__ */ jsx18(DialogPrimitive.Overlay, { className: "bg-v2-canvas/80 fixed inset-0 z-50 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 motion-reduce:animate-none" }),
|
|
1569
|
+
/* @__PURE__ */ jsxs10(
|
|
1570
|
+
DialogPrimitive.Content,
|
|
1571
|
+
{
|
|
1572
|
+
ref,
|
|
1573
|
+
className: cn(dialogContentStyles({ size }), className),
|
|
1574
|
+
onInteractOutside: keepOpenOnToast(onInteractOutside),
|
|
1575
|
+
...props,
|
|
1576
|
+
children: [
|
|
1577
|
+
children,
|
|
1578
|
+
!hideCloseButton && /* @__PURE__ */ jsx18(
|
|
1579
|
+
DialogPrimitive.Close,
|
|
1580
|
+
{
|
|
1581
|
+
"aria-label": "Fechar",
|
|
1582
|
+
className: "absolute right-3 top-3 inline-flex size-8 items-center justify-center rounded-v2-md text-v2-fg-subtle opacity-70 transition-opacity hover:bg-v2-raised hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-v2-focus-ring/30 disabled:pointer-events-none motion-reduce:transition-none",
|
|
1583
|
+
children: /* @__PURE__ */ jsx18(X2, { size: 16, weight: "bold", "aria-hidden": "true" })
|
|
1584
|
+
}
|
|
1585
|
+
)
|
|
1586
|
+
]
|
|
1587
|
+
}
|
|
1588
|
+
)
|
|
1589
|
+
] })
|
|
1590
|
+
);
|
|
1578
1591
|
Content4.displayName = "Dialog.Content";
|
|
1579
1592
|
var Header2 = forwardRef13(
|
|
1580
1593
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx18(
|
|
@@ -2502,6 +2515,7 @@ var Content6 = forwardRef16(
|
|
|
2502
2515
|
hideCloseButton,
|
|
2503
2516
|
className,
|
|
2504
2517
|
children,
|
|
2518
|
+
onInteractOutside,
|
|
2505
2519
|
...props
|
|
2506
2520
|
}, ref) => /* @__PURE__ */ jsxs14(DialogPrimitive2.Portal, { children: [
|
|
2507
2521
|
/* @__PURE__ */ jsx23(DialogPrimitive2.Overlay, { className: "bg-v2-canvas/80 fixed inset-0 z-50 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 motion-reduce:animate-none" }),
|
|
@@ -2510,6 +2524,7 @@ var Content6 = forwardRef16(
|
|
|
2510
2524
|
{
|
|
2511
2525
|
ref,
|
|
2512
2526
|
className: cn(drawerContentStyles({ side, size }), className),
|
|
2527
|
+
onInteractOutside: keepOpenOnToast(onInteractOutside),
|
|
2513
2528
|
...props,
|
|
2514
2529
|
children: [
|
|
2515
2530
|
children,
|
|
@@ -3028,6 +3043,7 @@ var FileUpload = forwardRef21(
|
|
|
3028
3043
|
role: "button",
|
|
3029
3044
|
tabIndex: disabled ? -1 : 0,
|
|
3030
3045
|
"aria-disabled": disabled || void 0,
|
|
3046
|
+
"data-invalid": displayError ? "true" : void 0,
|
|
3031
3047
|
onClick: () => !disabled && inputRef.current?.click(),
|
|
3032
3048
|
onKeyDown: (e) => {
|
|
3033
3049
|
if ((e.key === "Enter" || e.key === " ") && !disabled) {
|
|
@@ -3085,6 +3101,7 @@ var FileUpload = forwardRef21(
|
|
|
3085
3101
|
accept,
|
|
3086
3102
|
multiple,
|
|
3087
3103
|
disabled,
|
|
3104
|
+
"aria-invalid": displayError ? true : void 0,
|
|
3088
3105
|
className: "hidden",
|
|
3089
3106
|
onChange: (e) => handleFiles(e.target.files)
|
|
3090
3107
|
}
|
|
@@ -4240,6 +4257,7 @@ var OtpInput = forwardRef27(
|
|
|
4240
4257
|
onChange,
|
|
4241
4258
|
maxLength: length,
|
|
4242
4259
|
pattern: REGEXP_ONLY_DIGITS,
|
|
4260
|
+
"aria-invalid": error ? true : void 0,
|
|
4243
4261
|
containerClassName: cn(
|
|
4244
4262
|
"flex items-center gap-2 overflow-hidden p-1 has-[:disabled]:opacity-50",
|
|
4245
4263
|
className
|
package/package.json
CHANGED