@octax-app/hot-date-react 0.0.9 → 0.1.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/README.md CHANGED
@@ -51,6 +51,20 @@ function MyForm() {
51
51
  />
52
52
  ```
53
53
 
54
+ ### Combined (point + range)
55
+
56
+ ```tsx
57
+ <HotDate
58
+ dateType="combined"
59
+ onChange={(value) => console.log(value)}
60
+ // "tomorrow" → "2026-05-18"
61
+ // "this week" → ["2026-05-12", "2026-05-18"]
62
+ // "jan to feb" → ["2026-01-01", "2026-02-28"]
63
+ />
64
+ ```
65
+
66
+ `combined` accepts both single dates and ranges. `onChange` returns a `string` for point dates and `[string, string]` for ranges — the same shapes as the dedicated modes.
67
+
54
68
  ### Custom output format
55
69
 
56
70
  ```tsx
@@ -232,7 +246,7 @@ When `value` is provided the input renders in display mode — showing the forma
232
246
  | `onMouseUp` | `(e: MouseEvent) => void` | — | Fires on mouseup. |
233
247
  | `onMouseMove` | `(e: MouseEvent) => void` | — | Fires on mousemove. |
234
248
  | `format` | `string` | `"YYYY-MM-DD"` | Output format. Tokens: `YYYY MM DD YY M D` (case-insensitive). |
235
- | `dateType` | `"point" \| "range"` | `"point"` | Restrict input to single date or range. |
249
+ | `dateType` | `"point" \| "range" \| "combined"` | `"point"` | `"point"` = single date only, `"range"` = range only, `"combined"` = both simultaneously (returns `string` or `[string, string]`). |
236
250
  | `startDate` | `Date \| string` | — | Minimum date. Accepts a JS `Date` or `"YYYY-MM-DD"` string. |
237
251
  | `endDate` | `Date \| string` | — | Maximum date. Accepts a JS `Date` or `"YYYY-MM-DD"` string. |
238
252
  | `className` | `string` | — | CSS class on the host element. |
@@ -81,7 +81,7 @@ function p({ value: e, defaultValue: a, onChange: s, onCommit: c, onClear: l, on
81
81
  }, n = (t, n) => {
82
82
  n == null ? e.removeAttribute(t) : e.setAttribute(t, n);
83
83
  };
84
- n("placeholder", M), n("timezone", N), n("locale", P), n("week-start", F), n("start-date", f(O)), n("end-date", f(k)), n("mode", D), n("format", E), t("disabled", !!I), t("required", !!L), t("hide-hint", !Y), n("name", R);
84
+ n("placeholder", M), n("timezone", N), n("locale", P), n("week-start", F), n("start-date", f(O)), n("end-date", f(k)), n("mode", D === "combined" ? "any" : D), n("format", E), t("disabled", !!I), t("required", !!L), t("hide-hint", !Y), n("name", R);
85
85
  }, [
86
86
  M,
87
87
  N,
@@ -32,7 +32,7 @@ export interface HotDateProps {
32
32
  onMouseUp?: (e: MouseEvent) => void;
33
33
  onMouseMove?: (e: MouseEvent) => void;
34
34
  format?: string;
35
- dateType?: "point" | "range";
35
+ dateType?: "point" | "range" | "combined";
36
36
  startDate?: Date | string;
37
37
  endDate?: Date | string;
38
38
  className?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@octax-app/hot-date-react",
3
- "version": "0.0.9",
3
+ "version": "0.1.0",
4
4
  "description": "React wrapper for the hot-date natural language date input web component.",
5
5
  "type": "module",
6
6
  "main": "./dist/hot-date-react.js",