@clickpalm/react 1.3.3 → 1.3.5
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.ts +1 -0
- package/dist/index.js +16 -4
- package/dist/index.mjs +16 -4
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -3091,6 +3091,7 @@ interface TextInputProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
|
3091
3091
|
errorMessage?: string;
|
|
3092
3092
|
maxLength?: number;
|
|
3093
3093
|
showCounter?: boolean;
|
|
3094
|
+
redBorder?: boolean;
|
|
3094
3095
|
}
|
|
3095
3096
|
declare const Input: react__default.ForwardRefExoticComponent<TextInputProps & react__default.RefAttributes<HTMLInputElement>>;
|
|
3096
3097
|
|
package/dist/index.js
CHANGED
|
@@ -1247,6 +1247,15 @@ var TextInputContainer = styled("div", {
|
|
|
1247
1247
|
true: {
|
|
1248
1248
|
marginBottom: "0px"
|
|
1249
1249
|
}
|
|
1250
|
+
},
|
|
1251
|
+
redBorder: {
|
|
1252
|
+
true: {
|
|
1253
|
+
border: "1px solid $danger_dark",
|
|
1254
|
+
marginBottom: "0px",
|
|
1255
|
+
"&:has(input:focus), &:hover": {
|
|
1256
|
+
border: "1px solid $danger_dark"
|
|
1257
|
+
}
|
|
1258
|
+
}
|
|
1250
1259
|
}
|
|
1251
1260
|
}
|
|
1252
1261
|
});
|
|
@@ -1323,7 +1332,7 @@ var CharCounter = styled(Span2, {
|
|
|
1323
1332
|
// src/components/Input/index.tsx
|
|
1324
1333
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1325
1334
|
var Input2 = (0, import_react5.forwardRef)(
|
|
1326
|
-
({ prefix, suffix, label, maxLength, showCounter = false, errorMessage, noMargin = false, ...props }, forwardedRef) => {
|
|
1335
|
+
({ prefix, suffix, label, maxLength, showCounter = false, errorMessage, noMargin = false, redBorder, ...props }, forwardedRef) => {
|
|
1327
1336
|
const getDisplayValue = (value) => {
|
|
1328
1337
|
const stringValue = String(value || "");
|
|
1329
1338
|
if (prefix && stringValue.startsWith(prefix)) {
|
|
@@ -1359,6 +1368,7 @@ var Input2 = (0, import_react5.forwardRef)(
|
|
|
1359
1368
|
hasError: !!errorMessage,
|
|
1360
1369
|
hasCounter: showCounter,
|
|
1361
1370
|
onClick: handleContainerClick,
|
|
1371
|
+
redBorder,
|
|
1362
1372
|
children: [
|
|
1363
1373
|
!!prefix && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Prefix, { children: prefix }),
|
|
1364
1374
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
@@ -1738,6 +1748,7 @@ var Datepicker = (0, import_react7.forwardRef)(({ label, placeholder, value, onC
|
|
|
1738
1748
|
setMonth(selected);
|
|
1739
1749
|
}
|
|
1740
1750
|
}, [open, selected]);
|
|
1751
|
+
const isOpenWithError = open && errorMessage ? true : false;
|
|
1741
1752
|
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { children: [
|
|
1742
1753
|
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1743
1754
|
Input2,
|
|
@@ -1749,8 +1760,9 @@ var Datepicker = (0, import_react7.forwardRef)(({ label, placeholder, value, onC
|
|
|
1749
1760
|
value: value || "",
|
|
1750
1761
|
readOnly: true,
|
|
1751
1762
|
suffix: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Icon, { name: "Calendar", size: 16 }),
|
|
1752
|
-
|
|
1753
|
-
|
|
1763
|
+
noMargin: true,
|
|
1764
|
+
errorMessage: open ? "" : errorMessage,
|
|
1765
|
+
redBorder: isOpenWithError
|
|
1754
1766
|
}
|
|
1755
1767
|
),
|
|
1756
1768
|
open && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
@@ -2960,7 +2972,7 @@ var IconButton = styled("button", {
|
|
|
2960
2972
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
2961
2973
|
var Dropdown = ({ children }) => {
|
|
2962
2974
|
const childrenArray = import_react16.Children.toArray(children);
|
|
2963
|
-
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(DropdownMenu2.Root, { children: [
|
|
2975
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(DropdownMenu2.Root, { modal: false, children: [
|
|
2964
2976
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(DropdownMenu2.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Button, { variant: "secondary", size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Icon, { name: "Dots", size: 16 }) }) }),
|
|
2965
2977
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(DropdownMenu2.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(StyledContent2, { sideOffset: 5, align: "end", children: childrenArray.map((child, index) => /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_react16.Fragment, { children: [
|
|
2966
2978
|
child,
|
package/dist/index.mjs
CHANGED
|
@@ -1177,6 +1177,15 @@ var TextInputContainer = styled("div", {
|
|
|
1177
1177
|
true: {
|
|
1178
1178
|
marginBottom: "0px"
|
|
1179
1179
|
}
|
|
1180
|
+
},
|
|
1181
|
+
redBorder: {
|
|
1182
|
+
true: {
|
|
1183
|
+
border: "1px solid $danger_dark",
|
|
1184
|
+
marginBottom: "0px",
|
|
1185
|
+
"&:has(input:focus), &:hover": {
|
|
1186
|
+
border: "1px solid $danger_dark"
|
|
1187
|
+
}
|
|
1188
|
+
}
|
|
1180
1189
|
}
|
|
1181
1190
|
}
|
|
1182
1191
|
});
|
|
@@ -1253,7 +1262,7 @@ var CharCounter = styled(Span2, {
|
|
|
1253
1262
|
// src/components/Input/index.tsx
|
|
1254
1263
|
import { jsx as jsx19, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1255
1264
|
var Input2 = forwardRef3(
|
|
1256
|
-
({ prefix, suffix, label, maxLength, showCounter = false, errorMessage, noMargin = false, ...props }, forwardedRef) => {
|
|
1265
|
+
({ prefix, suffix, label, maxLength, showCounter = false, errorMessage, noMargin = false, redBorder, ...props }, forwardedRef) => {
|
|
1257
1266
|
const getDisplayValue = (value) => {
|
|
1258
1267
|
const stringValue = String(value || "");
|
|
1259
1268
|
if (prefix && stringValue.startsWith(prefix)) {
|
|
@@ -1289,6 +1298,7 @@ var Input2 = forwardRef3(
|
|
|
1289
1298
|
hasError: !!errorMessage,
|
|
1290
1299
|
hasCounter: showCounter,
|
|
1291
1300
|
onClick: handleContainerClick,
|
|
1301
|
+
redBorder,
|
|
1292
1302
|
children: [
|
|
1293
1303
|
!!prefix && /* @__PURE__ */ jsx19(Prefix, { children: prefix }),
|
|
1294
1304
|
/* @__PURE__ */ jsx19(
|
|
@@ -1668,6 +1678,7 @@ var Datepicker = forwardRef4(({ label, placeholder, value, onChange, errorMessag
|
|
|
1668
1678
|
setMonth(selected);
|
|
1669
1679
|
}
|
|
1670
1680
|
}, [open, selected]);
|
|
1681
|
+
const isOpenWithError = open && errorMessage ? true : false;
|
|
1671
1682
|
return /* @__PURE__ */ jsxs6("div", { children: [
|
|
1672
1683
|
/* @__PURE__ */ jsx22(
|
|
1673
1684
|
Input2,
|
|
@@ -1679,8 +1690,9 @@ var Datepicker = forwardRef4(({ label, placeholder, value, onChange, errorMessag
|
|
|
1679
1690
|
value: value || "",
|
|
1680
1691
|
readOnly: true,
|
|
1681
1692
|
suffix: /* @__PURE__ */ jsx22(Icon, { name: "Calendar", size: 16 }),
|
|
1682
|
-
|
|
1683
|
-
|
|
1693
|
+
noMargin: true,
|
|
1694
|
+
errorMessage: open ? "" : errorMessage,
|
|
1695
|
+
redBorder: isOpenWithError
|
|
1684
1696
|
}
|
|
1685
1697
|
),
|
|
1686
1698
|
open && /* @__PURE__ */ jsx22(
|
|
@@ -2890,7 +2902,7 @@ var IconButton = styled("button", {
|
|
|
2890
2902
|
import { jsx as jsx34, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2891
2903
|
var Dropdown = ({ children }) => {
|
|
2892
2904
|
const childrenArray = Children2.toArray(children);
|
|
2893
|
-
return /* @__PURE__ */ jsxs14(DropdownMenu2.Root, { children: [
|
|
2905
|
+
return /* @__PURE__ */ jsxs14(DropdownMenu2.Root, { modal: false, children: [
|
|
2894
2906
|
/* @__PURE__ */ jsx34(DropdownMenu2.Trigger, { asChild: true, children: /* @__PURE__ */ jsx34(Button, { variant: "secondary", size: "sm", children: /* @__PURE__ */ jsx34(Icon, { name: "Dots", size: 16 }) }) }),
|
|
2895
2907
|
/* @__PURE__ */ jsx34(DropdownMenu2.Portal, { children: /* @__PURE__ */ jsx34(StyledContent2, { sideOffset: 5, align: "end", children: childrenArray.map((child, index) => /* @__PURE__ */ jsxs14(Fragment2, { children: [
|
|
2896
2908
|
child,
|
package/package.json
CHANGED