@humu-tech/ui 0.1.12 → 0.1.14
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 +18 -25
- package/dist/index.mjs +18 -25
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1864,10 +1864,11 @@ var DateInput = (0, import_react22.forwardRef)(
|
|
|
1864
1864
|
const errorId = error ? `${triggerId}-error` : void 0;
|
|
1865
1865
|
const describedBy = [helperId, errorId].filter(Boolean).join(" ") || void 0;
|
|
1866
1866
|
const formatValue = (date) => (0, import_date_fns.format)(date, formatPattern, { locale });
|
|
1867
|
-
const
|
|
1867
|
+
const displayValueText = value ? formatValue(value) : "";
|
|
1868
|
+
const [text, setText] = (0, import_react22.useState)(displayValueText);
|
|
1868
1869
|
(0, import_react22.useEffect)(() => {
|
|
1869
|
-
setText(
|
|
1870
|
-
}, [
|
|
1870
|
+
setText(displayValueText);
|
|
1871
|
+
}, [displayValueText]);
|
|
1871
1872
|
const commitValue = (next) => {
|
|
1872
1873
|
if (!isControlled) setUncontrolled(next);
|
|
1873
1874
|
onValueChange == null ? void 0 : onValueChange(next);
|
|
@@ -1945,14 +1946,20 @@ var DateInput = (0, import_react22.forwardRef)(
|
|
|
1945
1946
|
className
|
|
1946
1947
|
),
|
|
1947
1948
|
children: [
|
|
1948
|
-
|
|
1949
|
-
|
|
1949
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Popover.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1950
|
+
"button",
|
|
1950
1951
|
{
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1952
|
+
type: "button",
|
|
1953
|
+
disabled,
|
|
1954
|
+
"aria-label": "Abrir calend\xE1rio",
|
|
1955
|
+
className: cn(
|
|
1956
|
+
"inline-flex shrink-0 items-center justify-center rounded-v2-sm p-0.5 text-v2-fg-muted transition-colors",
|
|
1957
|
+
"hover:text-v2-action-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-v2-focus-ring/30",
|
|
1958
|
+
"disabled:cursor-not-allowed"
|
|
1959
|
+
),
|
|
1960
|
+
children: leftIcon ?? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react23.CalendarBlank, { size: 18, "aria-hidden": "true" })
|
|
1954
1961
|
}
|
|
1955
|
-
),
|
|
1962
|
+
) }),
|
|
1956
1963
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1957
1964
|
"input",
|
|
1958
1965
|
{
|
|
@@ -1977,21 +1984,7 @@ var DateInput = (0, import_react22.forwardRef)(
|
|
|
1977
1984
|
),
|
|
1978
1985
|
...props
|
|
1979
1986
|
}
|
|
1980
|
-
)
|
|
1981
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Popover.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1982
|
-
"button",
|
|
1983
|
-
{
|
|
1984
|
-
type: "button",
|
|
1985
|
-
disabled,
|
|
1986
|
-
"aria-label": "Abrir calend\xE1rio",
|
|
1987
|
-
className: cn(
|
|
1988
|
-
"inline-flex shrink-0 items-center justify-center rounded-v2-sm p-0.5 text-v2-fg-muted transition-colors",
|
|
1989
|
-
"hover:text-v2-action-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-v2-focus-ring/30",
|
|
1990
|
-
"disabled:cursor-not-allowed"
|
|
1991
|
-
),
|
|
1992
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react23.CaretDown, { size: 16, "aria-hidden": "true" })
|
|
1993
|
-
}
|
|
1994
|
-
) })
|
|
1987
|
+
)
|
|
1995
1988
|
]
|
|
1996
1989
|
}
|
|
1997
1990
|
),
|
|
@@ -3901,7 +3894,7 @@ var OtpInput = (0, import_react45.forwardRef)(
|
|
|
3901
3894
|
maxLength: length,
|
|
3902
3895
|
pattern: import_input_otp.REGEXP_ONLY_DIGITS,
|
|
3903
3896
|
containerClassName: cn(
|
|
3904
|
-
"flex items-center gap-2 has-[:disabled]:opacity-50",
|
|
3897
|
+
"flex items-center gap-2 overflow-hidden p-1 has-[:disabled]:opacity-50",
|
|
3905
3898
|
className
|
|
3906
3899
|
),
|
|
3907
3900
|
render: ({ slots }) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "flex items-center gap-2", children: slots.map((slot, idx) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(OtpSlot, { ...slot, isDark }, idx)) }),
|
package/dist/index.mjs
CHANGED
|
@@ -1754,10 +1754,11 @@ var DateInput = forwardRef14(
|
|
|
1754
1754
|
const errorId = error ? `${triggerId}-error` : void 0;
|
|
1755
1755
|
const describedBy = [helperId, errorId].filter(Boolean).join(" ") || void 0;
|
|
1756
1756
|
const formatValue = (date) => format(date, formatPattern, { locale });
|
|
1757
|
-
const
|
|
1757
|
+
const displayValueText = value ? formatValue(value) : "";
|
|
1758
|
+
const [text, setText] = useState6(displayValueText);
|
|
1758
1759
|
useEffect4(() => {
|
|
1759
|
-
setText(
|
|
1760
|
-
}, [
|
|
1760
|
+
setText(displayValueText);
|
|
1761
|
+
}, [displayValueText]);
|
|
1761
1762
|
const commitValue = (next) => {
|
|
1762
1763
|
if (!isControlled) setUncontrolled(next);
|
|
1763
1764
|
onValueChange == null ? void 0 : onValueChange(next);
|
|
@@ -1835,14 +1836,20 @@ var DateInput = forwardRef14(
|
|
|
1835
1836
|
className
|
|
1836
1837
|
),
|
|
1837
1838
|
children: [
|
|
1838
|
-
|
|
1839
|
-
|
|
1839
|
+
/* @__PURE__ */ jsx20(Popover.Trigger, { asChild: true, children: /* @__PURE__ */ jsx20(
|
|
1840
|
+
"button",
|
|
1840
1841
|
{
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1842
|
+
type: "button",
|
|
1843
|
+
disabled,
|
|
1844
|
+
"aria-label": "Abrir calend\xE1rio",
|
|
1845
|
+
className: cn(
|
|
1846
|
+
"inline-flex shrink-0 items-center justify-center rounded-v2-sm p-0.5 text-v2-fg-muted transition-colors",
|
|
1847
|
+
"hover:text-v2-action-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-v2-focus-ring/30",
|
|
1848
|
+
"disabled:cursor-not-allowed"
|
|
1849
|
+
),
|
|
1850
|
+
children: leftIcon ?? /* @__PURE__ */ jsx20(CalendarBlank, { size: 18, "aria-hidden": "true" })
|
|
1844
1851
|
}
|
|
1845
|
-
),
|
|
1852
|
+
) }),
|
|
1846
1853
|
/* @__PURE__ */ jsx20(
|
|
1847
1854
|
"input",
|
|
1848
1855
|
{
|
|
@@ -1867,21 +1874,7 @@ var DateInput = forwardRef14(
|
|
|
1867
1874
|
),
|
|
1868
1875
|
...props
|
|
1869
1876
|
}
|
|
1870
|
-
)
|
|
1871
|
-
/* @__PURE__ */ jsx20(Popover.Trigger, { asChild: true, children: /* @__PURE__ */ jsx20(
|
|
1872
|
-
"button",
|
|
1873
|
-
{
|
|
1874
|
-
type: "button",
|
|
1875
|
-
disabled,
|
|
1876
|
-
"aria-label": "Abrir calend\xE1rio",
|
|
1877
|
-
className: cn(
|
|
1878
|
-
"inline-flex shrink-0 items-center justify-center rounded-v2-sm p-0.5 text-v2-fg-muted transition-colors",
|
|
1879
|
-
"hover:text-v2-action-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-v2-focus-ring/30",
|
|
1880
|
-
"disabled:cursor-not-allowed"
|
|
1881
|
-
),
|
|
1882
|
-
children: /* @__PURE__ */ jsx20(CaretDown2, { size: 16, "aria-hidden": "true" })
|
|
1883
|
-
}
|
|
1884
|
-
) })
|
|
1877
|
+
)
|
|
1885
1878
|
]
|
|
1886
1879
|
}
|
|
1887
1880
|
),
|
|
@@ -3810,7 +3803,7 @@ var OtpInput = forwardRef27(
|
|
|
3810
3803
|
maxLength: length,
|
|
3811
3804
|
pattern: REGEXP_ONLY_DIGITS,
|
|
3812
3805
|
containerClassName: cn(
|
|
3813
|
-
"flex items-center gap-2 has-[:disabled]:opacity-50",
|
|
3806
|
+
"flex items-center gap-2 overflow-hidden p-1 has-[:disabled]:opacity-50",
|
|
3814
3807
|
className
|
|
3815
3808
|
),
|
|
3816
3809
|
render: ({ slots }) => /* @__PURE__ */ jsx36("div", { className: "flex items-center gap-2", children: slots.map((slot, idx) => /* @__PURE__ */ jsx36(OtpSlot, { ...slot, isDark }, idx)) }),
|