@bookinglab/booking-ui-react 1.13.0 → 1.14.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/index.d.cts +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +16 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -869,8 +869,14 @@ interface BookingFormClassNames {
|
|
|
869
869
|
dateInputItem?: string;
|
|
870
870
|
/** Small "Day"/"Month"/"Year" label */
|
|
871
871
|
dateInputLabel?: string;
|
|
872
|
-
/** Date sub-input element (falls back to `input` / `inputError`) */
|
|
872
|
+
/** Date sub-input element (falls back to `input` / `inputError`). Applies to all 3 inputs unless overridden by dateInputDay/Month/Year. */
|
|
873
873
|
dateInput?: string;
|
|
874
|
+
/** Day input specifically (falls back to `dateInput`) */
|
|
875
|
+
dateInputDay?: string;
|
|
876
|
+
/** Month input specifically (falls back to `dateInput`) */
|
|
877
|
+
dateInputMonth?: string;
|
|
878
|
+
/** Year input specifically (falls back to `dateInput`) */
|
|
879
|
+
dateInputYear?: string;
|
|
874
880
|
}
|
|
875
881
|
interface BookingFormProps {
|
|
876
882
|
questions: Question[];
|
package/dist/index.d.ts
CHANGED
|
@@ -869,8 +869,14 @@ interface BookingFormClassNames {
|
|
|
869
869
|
dateInputItem?: string;
|
|
870
870
|
/** Small "Day"/"Month"/"Year" label */
|
|
871
871
|
dateInputLabel?: string;
|
|
872
|
-
/** Date sub-input element (falls back to `input` / `inputError`) */
|
|
872
|
+
/** Date sub-input element (falls back to `input` / `inputError`). Applies to all 3 inputs unless overridden by dateInputDay/Month/Year. */
|
|
873
873
|
dateInput?: string;
|
|
874
|
+
/** Day input specifically (falls back to `dateInput`) */
|
|
875
|
+
dateInputDay?: string;
|
|
876
|
+
/** Month input specifically (falls back to `dateInput`) */
|
|
877
|
+
dateInputMonth?: string;
|
|
878
|
+
/** Year input specifically (falls back to `dateInput`) */
|
|
879
|
+
dateInputYear?: string;
|
|
874
880
|
}
|
|
875
881
|
interface BookingFormProps {
|
|
876
882
|
questions: Question[];
|
package/dist/index.js
CHANGED
|
@@ -24,6 +24,9 @@ function DateInputGroup({
|
|
|
24
24
|
itemCls,
|
|
25
25
|
sublabelCls,
|
|
26
26
|
dateInputCls,
|
|
27
|
+
dayInputCls,
|
|
28
|
+
monthInputCls,
|
|
29
|
+
yearInputCls,
|
|
27
30
|
helpTextAbove,
|
|
28
31
|
helpTextBelow,
|
|
29
32
|
renderError
|
|
@@ -63,7 +66,7 @@ function DateInputGroup({
|
|
|
63
66
|
return /* @__PURE__ */ jsxRuntime.jsxs("fieldset", { className: fieldsetCls, "aria-describedby": hasError ? errorId : void 0, children: [
|
|
64
67
|
/* @__PURE__ */ jsxRuntime.jsxs("legend", { className: legendCls, children: [
|
|
65
68
|
question.name,
|
|
66
|
-
question.required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "
|
|
69
|
+
question.required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-1", style: { color: "#DD2D1D" }, "aria-hidden": "true", children: "*" })
|
|
67
70
|
] }),
|
|
68
71
|
helpTextAbove,
|
|
69
72
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: groupCls, role: "group", children: [
|
|
@@ -79,7 +82,7 @@ function DateInputGroup({
|
|
|
79
82
|
maxLength: 2,
|
|
80
83
|
value: parts.day,
|
|
81
84
|
onChange: (e) => handleSubChange("day", e.target.value),
|
|
82
|
-
className: cx(dateInputCls, "w-16"),
|
|
85
|
+
className: cx(dayInputCls ?? dateInputCls, "w-16"),
|
|
83
86
|
"aria-invalid": hasError ? true : void 0,
|
|
84
87
|
"aria-required": question.required || void 0
|
|
85
88
|
}
|
|
@@ -97,7 +100,7 @@ function DateInputGroup({
|
|
|
97
100
|
maxLength: 2,
|
|
98
101
|
value: parts.month,
|
|
99
102
|
onChange: (e) => handleSubChange("month", e.target.value),
|
|
100
|
-
className: cx(dateInputCls, "w-16"),
|
|
103
|
+
className: cx(monthInputCls ?? dateInputCls, "w-16"),
|
|
101
104
|
"aria-invalid": hasError ? true : void 0,
|
|
102
105
|
"aria-required": question.required || void 0
|
|
103
106
|
}
|
|
@@ -115,7 +118,7 @@ function DateInputGroup({
|
|
|
115
118
|
maxLength: 4,
|
|
116
119
|
value: parts.year,
|
|
117
120
|
onChange: (e) => handleSubChange("year", e.target.value),
|
|
118
|
-
className: cx(dateInputCls, "w-24"),
|
|
121
|
+
className: cx(yearInputCls ?? dateInputCls, "w-24"),
|
|
119
122
|
"aria-invalid": hasError ? true : void 0,
|
|
120
123
|
"aria-required": question.required || void 0
|
|
121
124
|
}
|
|
@@ -152,7 +155,7 @@ function FormField({
|
|
|
152
155
|
if (question.detail_type === "heading") return null;
|
|
153
156
|
return /* @__PURE__ */ jsxRuntime.jsxs("label", { htmlFor: inputId, className: labelClasses, children: [
|
|
154
157
|
question.name,
|
|
155
|
-
question.required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "
|
|
158
|
+
question.required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-1", style: { color: "#DD2D1D" }, "aria-hidden": "true", children: "*" })
|
|
156
159
|
] });
|
|
157
160
|
};
|
|
158
161
|
const renderHelpText = () => {
|
|
@@ -283,6 +286,10 @@ function FormField({
|
|
|
283
286
|
const groupCls = classNames?.dateInputGroup ?? "flex flex-row gap-3 items-end";
|
|
284
287
|
const legendCls = classNames?.dateLegend ?? labelClasses;
|
|
285
288
|
const fieldsetCls = classNames?.dateFieldset ?? (classNames?.fieldWrapper ?? defaultFieldWrapper);
|
|
289
|
+
const wrapPerInput = (cls) => cls === void 0 ? void 0 : hasError ? cx(cls, classNames?.inputError ?? defaultInputError) : cls;
|
|
290
|
+
const dayInputCls = wrapPerInput(classNames?.dateInputDay);
|
|
291
|
+
const monthInputCls = wrapPerInput(classNames?.dateInputMonth);
|
|
292
|
+
const yearInputCls = wrapPerInput(classNames?.dateInputYear);
|
|
286
293
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
287
294
|
DateInputGroup,
|
|
288
295
|
{
|
|
@@ -298,6 +305,9 @@ function FormField({
|
|
|
298
305
|
itemCls,
|
|
299
306
|
sublabelCls,
|
|
300
307
|
dateInputCls,
|
|
308
|
+
dayInputCls,
|
|
309
|
+
monthInputCls,
|
|
310
|
+
yearInputCls,
|
|
301
311
|
helpTextAbove,
|
|
302
312
|
helpTextBelow,
|
|
303
313
|
renderError
|
|
@@ -342,7 +352,7 @@ function FormField({
|
|
|
342
352
|
),
|
|
343
353
|
/* @__PURE__ */ jsxRuntime.jsxs("label", { htmlFor: inputId, className: checkboxLabelClasses, children: [
|
|
344
354
|
question.name,
|
|
345
|
-
question.required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "
|
|
355
|
+
question.required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-1", style: { color: "#DD2D1D" }, "aria-hidden": "true", children: "*" })
|
|
346
356
|
] })
|
|
347
357
|
] }),
|
|
348
358
|
helpTextBelow,
|