@trackunit/react-form-components 0.0.168 → 0.0.170
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/index.cjs.js +8 -8
- package/index.esm.js +8 -8
- package/package.json +2 -2
package/index.cjs.js
CHANGED
|
@@ -284,7 +284,7 @@ const cvaLabel = cssClassVarianceUtilities.cvaMerge([
|
|
|
284
284
|
], {
|
|
285
285
|
variants: {
|
|
286
286
|
invalid: {
|
|
287
|
-
true: "text-red-600 hover:text-red-700
|
|
287
|
+
true: "text-red-600 hover:text-red-700 active:text-red-700 group-hover:text-red-700 group-active:text-red-700",
|
|
288
288
|
false: "",
|
|
289
289
|
},
|
|
290
290
|
disabled: {
|
|
@@ -3162,7 +3162,7 @@ const cvaOptionCardContainer = cssClassVarianceUtilities.cvaMerge(["contents"]);
|
|
|
3162
3162
|
const OptionCard = React.forwardRef((_a, ref) => {
|
|
3163
3163
|
var { icon, heading, subheading, description, disabled, id, value, className, dataTestId } = _a, rest = __rest(_a, ["icon", "heading", "subheading", "description", "disabled", "id", "value", "className", "dataTestId"]);
|
|
3164
3164
|
const htmlForId = id !== null && id !== void 0 ? id : "option-card-" + v4();
|
|
3165
|
-
return (jsxRuntime.jsxs("div", { "data-testid": dataTestId, className: cvaOptionCardContainer(), children: [jsxRuntime.jsx("input", Object.assign({ ref: ref, id: htmlForId, type: "radio", value: value, className: "hidden
|
|
3165
|
+
return (jsxRuntime.jsxs("div", { "data-testid": dataTestId, className: cvaOptionCardContainer(), children: [jsxRuntime.jsx("input", Object.assign({ ref: ref, id: htmlForId, type: "radio", value: value, className: "peer hidden" }, rest)), jsxRuntime.jsxs("label", { htmlFor: htmlForId, className: cvaOptionCardLabel({ className, disabled }), children: [disabled && icon && React.cloneElement(icon, { className: `${icon.props.className} text-secondary-400` }), !disabled && icon, heading && (jsxRuntime.jsx(reactComponents.Heading, { variant: "secondary", subtle: disabled, children: heading })), (subheading || description) && (jsxRuntime.jsxs("div", { className: cvaOptionCardContent(), children: [subheading && (jsxRuntime.jsx(reactComponents.Text, { weight: "thick", align: "center", subtle: disabled, children: subheading })), description && (jsxRuntime.jsx(reactComponents.Text, { type: "span", subtle: true, align: "center", children: description }))] }))] })] }));
|
|
3166
3166
|
});
|
|
3167
3167
|
|
|
3168
3168
|
// This file is a workaround for a bug in web browsers' "native"
|
|
@@ -13992,7 +13992,7 @@ const cvaSelect = cssClassVarianceUtilities.cvaMerge([
|
|
|
13992
13992
|
], {
|
|
13993
13993
|
variants: {
|
|
13994
13994
|
invalid: {
|
|
13995
|
-
true: "border-red-600 text-red-600
|
|
13995
|
+
true: "border-red-600 text-red-600 focus-within:ring-red-600 hover:border-red-600",
|
|
13996
13996
|
false: "",
|
|
13997
13997
|
},
|
|
13998
13998
|
disabled: {
|
|
@@ -14005,10 +14005,10 @@ const cvaSelect = cssClassVarianceUtilities.cvaMerge([
|
|
|
14005
14005
|
disabled: false,
|
|
14006
14006
|
},
|
|
14007
14007
|
});
|
|
14008
|
-
const cvaSelectIcon = cssClassVarianceUtilities.cvaMerge("flex
|
|
14008
|
+
const cvaSelectIcon = cssClassVarianceUtilities.cvaMerge("mr-2 flex cursor-pointer items-center justify-center text-slate-400 hover:text-slate-500");
|
|
14009
14009
|
const cvaSelectPrefix = cssClassVarianceUtilities.cvaMerge(["flex", "justify-center", "items-center", "text-slate-400", "pl-2"]);
|
|
14010
14010
|
const cvaSelectXIcon = cssClassVarianceUtilities.cvaMerge([
|
|
14011
|
-
"flex
|
|
14011
|
+
"mr-2 flex cursor-pointer items-center justify-center text-slate-400 hover:text-slate-500",
|
|
14012
14012
|
"ml-1",
|
|
14013
14013
|
]);
|
|
14014
14014
|
const cvaSelectMenuList = cssClassVarianceUtilities.cvaMerge(["min-w-min", "shadow-md", "rounded-lg", "z-20", "bg-white", "p-1", "border", "border-slate-300", "gap-1", "grid"], {
|
|
@@ -14170,7 +14170,7 @@ const TagsContainer = ({ items, width = "100%", itemsGap = 5, postFix, disabled
|
|
|
14170
14170
|
}
|
|
14171
14171
|
const itemCanFit = spaceNeeded <= availableSpace;
|
|
14172
14172
|
if (itemCanFit) {
|
|
14173
|
-
return (jsxRuntime.jsx(TagWithWidth, { onWidthKnown: onWidthKnownHandler, className: "shrink-0
|
|
14173
|
+
return (jsxRuntime.jsx(TagWithWidth, { onWidthKnown: onWidthKnownHandler, className: "inline-flex shrink-0", onClose: e => {
|
|
14174
14174
|
e.stopPropagation();
|
|
14175
14175
|
item.onClick();
|
|
14176
14176
|
}, color: item.disabled ? "unknown" : "primary", dataTestId: item.text, disabled: disabled, children: item.text }, item.text + index));
|
|
@@ -14229,7 +14229,7 @@ const useCustomComponents = (componentsProps, disabled, menuIsOpen, refMenuIsEna
|
|
|
14229
14229
|
: [], postFix: searchInput, disabled: disabled })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [tags &&
|
|
14230
14230
|
tags.slice(0, maxSelectedDisplayCount).map(({ props: tagProps }) => {
|
|
14231
14231
|
var _a, _b;
|
|
14232
|
-
return (jsxRuntime.jsx(reactComponents.Tag, { className: "shrink-0
|
|
14232
|
+
return (jsxRuntime.jsx(reactComponents.Tag, { className: "inline-flex shrink-0", onClose: e => {
|
|
14233
14233
|
var _a, _b;
|
|
14234
14234
|
e.stopPropagation();
|
|
14235
14235
|
refMenuIsEnabled.current = false;
|
|
@@ -14574,7 +14574,7 @@ const PhoneInput = React.forwardRef((_a, ref) => {
|
|
|
14574
14574
|
// the event's type is inferred as Event, which doesn't have a target property, whereas ChangeEvent does.
|
|
14575
14575
|
onChange && onChange(event);
|
|
14576
14576
|
}, [phoneNumber, onChange]);
|
|
14577
|
-
return (jsxRuntime.jsxs("div", { className: "grid
|
|
14577
|
+
return (jsxRuntime.jsxs("div", { className: "grid-cols-min-fr grid gap-2", "data-testid": dataTestId && `${dataTestId}-container`, children: [jsxRuntime.jsx("input", { hidden: true, id: "phone-input", "data-testid": dataTestId, value: phoneNumber, ref: hiddenInputRef, onChange: onChange, "aria-invalid": isInvalid }), jsxRuntime.jsx(CountryCodeSelect, { dataTestId: dataTestId && `${dataTestId}-countryCodeSelect`, countryCode: code, onBlur: e => {
|
|
14578
14578
|
onBlurHandler();
|
|
14579
14579
|
}, onChange: e => {
|
|
14580
14580
|
var _a;
|
package/index.esm.js
CHANGED
|
@@ -258,7 +258,7 @@ const cvaLabel = cvaMerge([
|
|
|
258
258
|
], {
|
|
259
259
|
variants: {
|
|
260
260
|
invalid: {
|
|
261
|
-
true: "text-red-600 hover:text-red-700
|
|
261
|
+
true: "text-red-600 hover:text-red-700 active:text-red-700 group-hover:text-red-700 group-active:text-red-700",
|
|
262
262
|
false: "",
|
|
263
263
|
},
|
|
264
264
|
disabled: {
|
|
@@ -3136,7 +3136,7 @@ const cvaOptionCardContainer = cvaMerge(["contents"]);
|
|
|
3136
3136
|
const OptionCard = forwardRef((_a, ref) => {
|
|
3137
3137
|
var { icon, heading, subheading, description, disabled, id, value, className, dataTestId } = _a, rest = __rest(_a, ["icon", "heading", "subheading", "description", "disabled", "id", "value", "className", "dataTestId"]);
|
|
3138
3138
|
const htmlForId = id !== null && id !== void 0 ? id : "option-card-" + v4();
|
|
3139
|
-
return (jsxs("div", { "data-testid": dataTestId, className: cvaOptionCardContainer(), children: [jsx$1("input", Object.assign({ ref: ref, id: htmlForId, type: "radio", value: value, className: "hidden
|
|
3139
|
+
return (jsxs("div", { "data-testid": dataTestId, className: cvaOptionCardContainer(), children: [jsx$1("input", Object.assign({ ref: ref, id: htmlForId, type: "radio", value: value, className: "peer hidden" }, rest)), jsxs("label", { htmlFor: htmlForId, className: cvaOptionCardLabel({ className, disabled }), children: [disabled && icon && cloneElement(icon, { className: `${icon.props.className} text-secondary-400` }), !disabled && icon, heading && (jsx$1(Heading, { variant: "secondary", subtle: disabled, children: heading })), (subheading || description) && (jsxs("div", { className: cvaOptionCardContent(), children: [subheading && (jsx$1(Text, { weight: "thick", align: "center", subtle: disabled, children: subheading })), description && (jsx$1(Text, { type: "span", subtle: true, align: "center", children: description }))] }))] })] }));
|
|
3140
3140
|
});
|
|
3141
3141
|
|
|
3142
3142
|
// This file is a workaround for a bug in web browsers' "native"
|
|
@@ -13966,7 +13966,7 @@ const cvaSelect = cvaMerge([
|
|
|
13966
13966
|
], {
|
|
13967
13967
|
variants: {
|
|
13968
13968
|
invalid: {
|
|
13969
|
-
true: "border-red-600 text-red-600
|
|
13969
|
+
true: "border-red-600 text-red-600 focus-within:ring-red-600 hover:border-red-600",
|
|
13970
13970
|
false: "",
|
|
13971
13971
|
},
|
|
13972
13972
|
disabled: {
|
|
@@ -13979,10 +13979,10 @@ const cvaSelect = cvaMerge([
|
|
|
13979
13979
|
disabled: false,
|
|
13980
13980
|
},
|
|
13981
13981
|
});
|
|
13982
|
-
const cvaSelectIcon = cvaMerge("flex
|
|
13982
|
+
const cvaSelectIcon = cvaMerge("mr-2 flex cursor-pointer items-center justify-center text-slate-400 hover:text-slate-500");
|
|
13983
13983
|
const cvaSelectPrefix = cvaMerge(["flex", "justify-center", "items-center", "text-slate-400", "pl-2"]);
|
|
13984
13984
|
const cvaSelectXIcon = cvaMerge([
|
|
13985
|
-
"flex
|
|
13985
|
+
"mr-2 flex cursor-pointer items-center justify-center text-slate-400 hover:text-slate-500",
|
|
13986
13986
|
"ml-1",
|
|
13987
13987
|
]);
|
|
13988
13988
|
const cvaSelectMenuList = cvaMerge(["min-w-min", "shadow-md", "rounded-lg", "z-20", "bg-white", "p-1", "border", "border-slate-300", "gap-1", "grid"], {
|
|
@@ -14144,7 +14144,7 @@ const TagsContainer = ({ items, width = "100%", itemsGap = 5, postFix, disabled
|
|
|
14144
14144
|
}
|
|
14145
14145
|
const itemCanFit = spaceNeeded <= availableSpace;
|
|
14146
14146
|
if (itemCanFit) {
|
|
14147
|
-
return (jsx$1(TagWithWidth, { onWidthKnown: onWidthKnownHandler, className: "shrink-0
|
|
14147
|
+
return (jsx$1(TagWithWidth, { onWidthKnown: onWidthKnownHandler, className: "inline-flex shrink-0", onClose: e => {
|
|
14148
14148
|
e.stopPropagation();
|
|
14149
14149
|
item.onClick();
|
|
14150
14150
|
}, color: item.disabled ? "unknown" : "primary", dataTestId: item.text, disabled: disabled, children: item.text }, item.text + index));
|
|
@@ -14203,7 +14203,7 @@ const useCustomComponents = (componentsProps, disabled, menuIsOpen, refMenuIsEna
|
|
|
14203
14203
|
: [], postFix: searchInput, disabled: disabled })) : (jsxs(Fragment$1, { children: [tags &&
|
|
14204
14204
|
tags.slice(0, maxSelectedDisplayCount).map(({ props: tagProps }) => {
|
|
14205
14205
|
var _a, _b;
|
|
14206
|
-
return (jsx$1(Tag, { className: "shrink-0
|
|
14206
|
+
return (jsx$1(Tag, { className: "inline-flex shrink-0", onClose: e => {
|
|
14207
14207
|
var _a, _b;
|
|
14208
14208
|
e.stopPropagation();
|
|
14209
14209
|
refMenuIsEnabled.current = false;
|
|
@@ -14548,7 +14548,7 @@ const PhoneInput = forwardRef((_a, ref) => {
|
|
|
14548
14548
|
// the event's type is inferred as Event, which doesn't have a target property, whereas ChangeEvent does.
|
|
14549
14549
|
onChange && onChange(event);
|
|
14550
14550
|
}, [phoneNumber, onChange]);
|
|
14551
|
-
return (jsxs("div", { className: "grid
|
|
14551
|
+
return (jsxs("div", { className: "grid-cols-min-fr grid gap-2", "data-testid": dataTestId && `${dataTestId}-container`, children: [jsx$1("input", { hidden: true, id: "phone-input", "data-testid": dataTestId, value: phoneNumber, ref: hiddenInputRef, onChange: onChange, "aria-invalid": isInvalid }), jsx$1(CountryCodeSelect, { dataTestId: dataTestId && `${dataTestId}-countryCodeSelect`, countryCode: code, onBlur: e => {
|
|
14552
14552
|
onBlurHandler();
|
|
14553
14553
|
}, onChange: e => {
|
|
14554
14554
|
var _a;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-form-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.170",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@trackunit/css-class-variance-utilities": "0.0.14",
|
|
11
11
|
"@trackunit/i18n-library-translation": "0.0.86",
|
|
12
|
-
"@trackunit/react-components": "0.1.
|
|
12
|
+
"@trackunit/react-components": "0.1.174",
|
|
13
13
|
"@trackunit/shared-utils": "0.0.11",
|
|
14
14
|
"@trackunit/ui-icons": "0.0.78",
|
|
15
15
|
"date-fns": "2.29.3",
|