@dashforge/tw 0.9.0-beta → 0.10.0-beta
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/CHANGELOG.md +60 -0
- package/dist/index.esm.js +1634 -256
- package/dist/src/components/Calendar/Calendar.d.ts +14 -0
- package/dist/src/components/Calendar/Calendar.d.ts.map +1 -0
- package/dist/src/components/Calendar/calendar.types.d.ts +72 -0
- package/dist/src/components/Calendar/calendar.types.d.ts.map +1 -0
- package/dist/src/components/Calendar/calendar.variants.d.ts +99 -0
- package/dist/src/components/Calendar/calendar.variants.d.ts.map +1 -0
- package/dist/src/components/DatePicker/DatePicker.d.ts +14 -0
- package/dist/src/components/DatePicker/DatePicker.d.ts.map +1 -0
- package/dist/src/components/DatePicker/datePicker.types.d.ts +88 -0
- package/dist/src/components/DatePicker/datePicker.types.d.ts.map +1 -0
- package/dist/src/components/DatePicker/datePicker.variants.d.ts +97 -0
- package/dist/src/components/DatePicker/datePicker.variants.d.ts.map +1 -0
- package/dist/src/components/DateRangePicker/DateRangePicker.d.ts +13 -0
- package/dist/src/components/DateRangePicker/DateRangePicker.d.ts.map +1 -0
- package/dist/src/components/DateRangePicker/dateRangePicker.types.d.ts +85 -0
- package/dist/src/components/DateRangePicker/dateRangePicker.types.d.ts.map +1 -0
- package/dist/src/components/DateRangePicker/dateRangePicker.variants.d.ts +183 -0
- package/dist/src/components/DateRangePicker/dateRangePicker.variants.d.ts.map +1 -0
- package/dist/src/components/DateTimePicker/DateTimePicker.d.ts +7 -43
- package/dist/src/components/DateTimePicker/DateTimePicker.d.ts.map +1 -1
- package/dist/src/components/DateTimePicker/dateTimePicker.types.d.ts +50 -55
- package/dist/src/components/DateTimePicker/dateTimePicker.types.d.ts.map +1 -1
- package/dist/src/components/DateTimePicker/dateTimePicker.variants.d.ts +36 -94
- package/dist/src/components/DateTimePicker/dateTimePicker.variants.d.ts.map +1 -1
- package/dist/src/components/TimePicker/TimePicker.d.ts +12 -0
- package/dist/src/components/TimePicker/TimePicker.d.ts.map +1 -0
- package/dist/src/components/TimePicker/timePicker.types.d.ts +80 -0
- package/dist/src/components/TimePicker/timePicker.types.d.ts.map +1 -0
- package/dist/src/components/TimePicker/timePicker.variants.d.ts +103 -0
- package/dist/src/components/TimePicker/timePicker.variants.d.ts.map +1 -0
- package/dist/src/index.d.ts +15 -3
- package/dist/src/index.d.ts.map +1 -1
- package/package.json +4 -3
- package/src/components/Calendar/Calendar.test.tsx +75 -0
- package/src/components/Calendar/Calendar.tsx +264 -0
- package/src/components/Calendar/calendar.types.ts +65 -0
- package/src/components/Calendar/calendar.variants.ts +64 -0
- package/src/components/DatePicker/DatePicker.test.tsx +76 -0
- package/src/components/DatePicker/DatePicker.tsx +305 -0
- package/src/components/DatePicker/datePicker.types.ts +77 -0
- package/src/components/DatePicker/datePicker.variants.ts +50 -0
- package/src/components/DateRangePicker/DateRangePicker.test.tsx +92 -0
- package/src/components/DateRangePicker/DateRangePicker.tsx +510 -0
- package/src/components/DateRangePicker/dateRangePicker.types.ts +74 -0
- package/src/components/DateRangePicker/dateRangePicker.variants.ts +101 -0
- package/src/components/DateTimePicker/DateTimePicker.test.tsx +60 -186
- package/src/components/DateTimePicker/DateTimePicker.tsx +209 -181
- package/src/components/DateTimePicker/dateTimePicker.types.ts +50 -54
- package/src/components/DateTimePicker/dateTimePicker.variants.ts +22 -51
- package/src/components/TimePicker/TimePicker.test.tsx +65 -0
- package/src/components/TimePicker/TimePicker.tsx +274 -0
- package/src/components/TimePicker/timePicker.types.ts +69 -0
- package/src/components/TimePicker/timePicker.variants.ts +53 -0
- package/src/index.ts +38 -6
- package/tsconfig.lib.json +7 -4
- package/src/components/DateTimePicker/DateTimePicker.perf.test.tsx +0 -153
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CalendarProps } from './calendar.types.js';
|
|
2
|
+
/**
|
|
3
|
+
* `<Calendar>` — a standalone, inline month-grid date picker.
|
|
4
|
+
*
|
|
5
|
+
* The Tailwind presentation layer over the headless `useCalendar` engine
|
|
6
|
+
* from `@dashforge/calendar-core` (the same engine the MUI `@dashforge/ui`
|
|
7
|
+
* calendar consumes — only the skin differs). Implements the WCAG grid
|
|
8
|
+
* pattern with roving tab-index focus.
|
|
9
|
+
*
|
|
10
|
+
* It is a primitive: no form-bridge / RBAC integration — use `<DatePicker>`
|
|
11
|
+
* for a form-bound date field.
|
|
12
|
+
*/
|
|
13
|
+
export declare function Calendar(props: CalendarProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
//# sourceMappingURL=Calendar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Calendar.d.ts","sourceRoot":"","sources":["../../../../src/components/Calendar/Calendar.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AA2CzD;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,2CAuM5C"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { ISODate, WeekDay } from '@dashforge/calendar-core';
|
|
2
|
+
/** Per-slot `className` overrides for `<Calendar>`. */
|
|
3
|
+
export interface CalendarSlotProps {
|
|
4
|
+
root?: {
|
|
5
|
+
className?: string;
|
|
6
|
+
};
|
|
7
|
+
header?: {
|
|
8
|
+
className?: string;
|
|
9
|
+
};
|
|
10
|
+
grid?: {
|
|
11
|
+
className?: string;
|
|
12
|
+
};
|
|
13
|
+
/** Applied to every day-cell button. */
|
|
14
|
+
day?: {
|
|
15
|
+
className?: string;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Props for the `<Calendar>` primitive — a standalone, inline month grid.
|
|
20
|
+
*
|
|
21
|
+
* `Calendar` is NOT a form field (no bridge / RBAC integration). It is the
|
|
22
|
+
* low-level building block used inside `<DatePicker>`. For a form-bound date
|
|
23
|
+
* input use `<DatePicker>`.
|
|
24
|
+
*
|
|
25
|
+
* Dates are ISO `YYYY-MM-DD` strings throughout. The headless date engine is
|
|
26
|
+
* `@dashforge/calendar-core` — shared with the MUI `@dashforge/ui` calendar.
|
|
27
|
+
*/
|
|
28
|
+
export interface CalendarProps {
|
|
29
|
+
/** Selected date (controlled). */
|
|
30
|
+
value?: ISODate | null;
|
|
31
|
+
/** Initial selected date (uncontrolled). */
|
|
32
|
+
defaultValue?: ISODate | null;
|
|
33
|
+
/** Fired when a day is chosen. */
|
|
34
|
+
onChange?: (value: ISODate) => void;
|
|
35
|
+
/** Controlled displayed month (1-indexed). Pair with `year`. */
|
|
36
|
+
month?: number;
|
|
37
|
+
/** Controlled displayed year. Pair with `month`. */
|
|
38
|
+
year?: number;
|
|
39
|
+
/** Initial displayed month (1-indexed, uncontrolled). */
|
|
40
|
+
defaultMonth?: number;
|
|
41
|
+
/** Initial displayed year (uncontrolled). */
|
|
42
|
+
defaultYear?: number;
|
|
43
|
+
/** Fired when the displayed month changes. */
|
|
44
|
+
onMonthChange?: (month: number, year: number) => void;
|
|
45
|
+
/** Earliest selectable date (inclusive). */
|
|
46
|
+
minDate?: ISODate;
|
|
47
|
+
/** Latest selectable date (inclusive). */
|
|
48
|
+
maxDate?: ISODate;
|
|
49
|
+
/** Explicit list of disabled dates. */
|
|
50
|
+
disabledDates?: readonly ISODate[];
|
|
51
|
+
/** Predicate marking arbitrary dates disabled. */
|
|
52
|
+
isDateDisabled?: (date: ISODate) => boolean;
|
|
53
|
+
/** Weekday of the grid's first column (`0` = Sunday). Default `0`. */
|
|
54
|
+
weekStartDay?: WeekDay;
|
|
55
|
+
/** BCP-47 locale for month/weekday names. Default `"en-US"`. */
|
|
56
|
+
locale?: string;
|
|
57
|
+
/** Overrides "today" (ISO `YYYY-MM-DD`), mainly for testing. */
|
|
58
|
+
today?: ISODate;
|
|
59
|
+
/** Disables the whole calendar. */
|
|
60
|
+
disabled?: boolean;
|
|
61
|
+
/** Moves DOM focus to the active day cell on mount. */
|
|
62
|
+
autoFocus?: boolean;
|
|
63
|
+
/** Accessible label for the grid. Default `"Calendar"`. */
|
|
64
|
+
'aria-label'?: string;
|
|
65
|
+
/** Root-level Tailwind class override. */
|
|
66
|
+
sx?: string;
|
|
67
|
+
/** Per-slot `className` overrides. */
|
|
68
|
+
slotProps?: CalendarSlotProps;
|
|
69
|
+
/** Test id applied to the root element. */
|
|
70
|
+
testId?: string;
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=calendar.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar.types.d.ts","sourceRoot":"","sources":["../../../../src/components/Calendar/calendar.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAEjE,uDAAuD;AACvD,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9B,MAAM,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAChC,IAAI,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9B,wCAAwC;IACxC,GAAG,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC9B;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,aAAa;IAC5B,kCAAkC;IAClC,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACvB,4CAA4C;IAC5C,YAAY,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC9B,kCAAkC;IAClC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACpC,gEAAgE;IAChE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oDAAoD;IACpD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,yDAAyD;IACzD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8CAA8C;IAC9C,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtD,4CAA4C;IAC5C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,0CAA0C;IAC1C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,uCAAuC;IACvC,aAAa,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IACnC,kDAAkD;IAClD,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC;IAC5C,sEAAsE;IACtE,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,gEAAgE;IAChE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gEAAgE;IAChE,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uDAAuD;IACvD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,2DAA2D;IAC3D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,0CAA0C;IAC1C,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,sCAAsC;IACtC,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAC9B,2CAA2C;IAC3C,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structural slots for `<Calendar>`.
|
|
3
|
+
*
|
|
4
|
+
* Theme identity: every class is a bare neutral / brand token-backed
|
|
5
|
+
* Tailwind class. The `dashforgePreset()` CSS-variable swap auto-inverts
|
|
6
|
+
* the neutral palette, so there are NO `dark:` variants here (a `dark:` on
|
|
7
|
+
* a neutral class would double-invert — see `_shared/themeIdentity.test.ts`).
|
|
8
|
+
*/
|
|
9
|
+
export declare const calendarVariants: import("tailwind-variants").TVReturnType<{
|
|
10
|
+
disabled: {
|
|
11
|
+
true: {
|
|
12
|
+
root: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
}, {
|
|
16
|
+
root: string;
|
|
17
|
+
header: string;
|
|
18
|
+
navButton: string;
|
|
19
|
+
monthLabel: string;
|
|
20
|
+
grid: string;
|
|
21
|
+
weekdayRow: string;
|
|
22
|
+
weekday: string;
|
|
23
|
+
weekRow: string;
|
|
24
|
+
}, undefined, {
|
|
25
|
+
disabled: {
|
|
26
|
+
true: {
|
|
27
|
+
root: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
}, {
|
|
31
|
+
root: string;
|
|
32
|
+
header: string;
|
|
33
|
+
navButton: string;
|
|
34
|
+
monthLabel: string;
|
|
35
|
+
grid: string;
|
|
36
|
+
weekdayRow: string;
|
|
37
|
+
weekday: string;
|
|
38
|
+
weekRow: string;
|
|
39
|
+
}, import("tailwind-variants").TVReturnType<{
|
|
40
|
+
disabled: {
|
|
41
|
+
true: {
|
|
42
|
+
root: string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
}, {
|
|
46
|
+
root: string;
|
|
47
|
+
header: string;
|
|
48
|
+
navButton: string;
|
|
49
|
+
monthLabel: string;
|
|
50
|
+
grid: string;
|
|
51
|
+
weekdayRow: string;
|
|
52
|
+
weekday: string;
|
|
53
|
+
weekRow: string;
|
|
54
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
55
|
+
/**
|
|
56
|
+
* Per-day-cell recipe. Each of the 42 grid cells is rendered with its own
|
|
57
|
+
* state (`siblingMonth` / `today` / `selected` / `disabled`).
|
|
58
|
+
*/
|
|
59
|
+
export declare const calendarDayVariants: import("tailwind-variants").TVReturnType<{
|
|
60
|
+
siblingMonth: {
|
|
61
|
+
true: string;
|
|
62
|
+
};
|
|
63
|
+
today: {
|
|
64
|
+
true: string;
|
|
65
|
+
};
|
|
66
|
+
selected: {
|
|
67
|
+
true: string;
|
|
68
|
+
};
|
|
69
|
+
disabled: {
|
|
70
|
+
true: string;
|
|
71
|
+
};
|
|
72
|
+
}, undefined, "flex h-9 w-9 items-center justify-center rounded-md text-sm text-neutral-900 transition-colors hover:bg-neutral-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary-500", {
|
|
73
|
+
siblingMonth: {
|
|
74
|
+
true: string;
|
|
75
|
+
};
|
|
76
|
+
today: {
|
|
77
|
+
true: string;
|
|
78
|
+
};
|
|
79
|
+
selected: {
|
|
80
|
+
true: string;
|
|
81
|
+
};
|
|
82
|
+
disabled: {
|
|
83
|
+
true: string;
|
|
84
|
+
};
|
|
85
|
+
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
86
|
+
siblingMonth: {
|
|
87
|
+
true: string;
|
|
88
|
+
};
|
|
89
|
+
today: {
|
|
90
|
+
true: string;
|
|
91
|
+
};
|
|
92
|
+
selected: {
|
|
93
|
+
true: string;
|
|
94
|
+
};
|
|
95
|
+
disabled: {
|
|
96
|
+
true: string;
|
|
97
|
+
};
|
|
98
|
+
}, undefined, "flex h-9 w-9 items-center justify-center rounded-md text-sm text-neutral-900 transition-colors hover:bg-neutral-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary-500", unknown, unknown, undefined>>;
|
|
99
|
+
//# sourceMappingURL=calendar.variants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar.variants.d.ts","sourceRoot":"","sources":["../../../../src/components/Calendar/calendar.variants.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAqB3B,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0QA0B9B,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { DatePickerProps } from './datePicker.types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Dashforge TW `<DatePicker>` — a form-bound single-date field.
|
|
4
|
+
*
|
|
5
|
+
* A read-only trigger button paired with a `<Calendar>` popover (Radix
|
|
6
|
+
* Popover — toggle / Escape / outside-click / focus-trap are Radix-managed).
|
|
7
|
+
* Integrates with the Dashforge form bridge + RBAC, mirroring the other
|
|
8
|
+
* `@dashforge/tw` form fields.
|
|
9
|
+
*
|
|
10
|
+
* Storage contract: an ISO `YYYY-MM-DD` string, or `null` — shared with the
|
|
11
|
+
* MUI `@dashforge/ui` `DatePicker`.
|
|
12
|
+
*/
|
|
13
|
+
export declare function DatePicker(props: DatePickerProps): import("react/jsx-runtime").JSX.Element | null;
|
|
14
|
+
//# sourceMappingURL=DatePicker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../../src/components/DatePicker/DatePicker.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAqD7D;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,kDAoOhD"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { Engine } from '@dashforge/ui-core';
|
|
3
|
+
import type { AccessRequirement } from '@dashforge/rbac';
|
|
4
|
+
import type { ISODate, WeekDay } from '@dashforge/calendar-core';
|
|
5
|
+
/** Per-slot `className` overrides for `<DatePicker>`. */
|
|
6
|
+
export interface DatePickerSlotProps {
|
|
7
|
+
root?: {
|
|
8
|
+
className?: string;
|
|
9
|
+
};
|
|
10
|
+
label?: {
|
|
11
|
+
className?: string;
|
|
12
|
+
};
|
|
13
|
+
requiredMark?: {
|
|
14
|
+
className?: string;
|
|
15
|
+
};
|
|
16
|
+
trigger?: {
|
|
17
|
+
className?: string;
|
|
18
|
+
};
|
|
19
|
+
helperText?: {
|
|
20
|
+
className?: string;
|
|
21
|
+
};
|
|
22
|
+
errorText?: {
|
|
23
|
+
className?: string;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Props for the `<DatePicker>` form field (Tailwind skin).
|
|
28
|
+
*
|
|
29
|
+
* A read-only trigger button paired with a `<Calendar>` popover, integrated
|
|
30
|
+
* with the Dashforge form bridge + RBAC. The stored value is a plain ISO
|
|
31
|
+
* calendar date — `YYYY-MM-DD` — or `null`. (A pure date carries no time or
|
|
32
|
+
* timezone, which removes the whole class of DST round-trip hazards.)
|
|
33
|
+
*
|
|
34
|
+
* The prop surface mirrors the MUI `@dashforge/ui` `DatePicker` so the API
|
|
35
|
+
* is consistent across both ecosystems; only the styling escape hatches
|
|
36
|
+
* (`sx` / `slotProps`) follow the Tailwind conventions.
|
|
37
|
+
*/
|
|
38
|
+
export interface DatePickerProps {
|
|
39
|
+
/** Field name — the bridge registration key. Required. */
|
|
40
|
+
name: string;
|
|
41
|
+
/** Validation rules forwarded to the form bridge. */
|
|
42
|
+
rules?: unknown;
|
|
43
|
+
/** Field label. */
|
|
44
|
+
label?: ReactNode;
|
|
45
|
+
/** Helper text below the control (overrides a bridge error message). */
|
|
46
|
+
helperText?: ReactNode;
|
|
47
|
+
/** Explicit error state (overrides the bridge's auto error). */
|
|
48
|
+
error?: boolean;
|
|
49
|
+
/** Marks the field required (adds the label asterisk). */
|
|
50
|
+
required?: boolean;
|
|
51
|
+
/** Disables the field. */
|
|
52
|
+
disabled?: boolean;
|
|
53
|
+
/** Placeholder shown when no date is selected. */
|
|
54
|
+
placeholder?: string;
|
|
55
|
+
/** Label/control layout. */
|
|
56
|
+
layout?: 'stacked' | 'inline';
|
|
57
|
+
/** Reactive visibility predicate evaluated against the form engine. */
|
|
58
|
+
visibleWhen?: (engine: Engine) => boolean;
|
|
59
|
+
/** RBAC access requirement. */
|
|
60
|
+
access?: AccessRequirement;
|
|
61
|
+
/** Controlled value — ISO `YYYY-MM-DD` or `null`. */
|
|
62
|
+
value?: ISODate | null;
|
|
63
|
+
/** Uncontrolled initial value. */
|
|
64
|
+
defaultValue?: ISODate | null;
|
|
65
|
+
/** Fired with the new ISO date (or `null` when cleared). */
|
|
66
|
+
onChange?: (value: ISODate | null) => void;
|
|
67
|
+
/** Earliest selectable date (inclusive). */
|
|
68
|
+
minDate?: ISODate;
|
|
69
|
+
/** Latest selectable date (inclusive). */
|
|
70
|
+
maxDate?: ISODate;
|
|
71
|
+
/** Explicit list of disabled dates. */
|
|
72
|
+
disabledDates?: readonly ISODate[];
|
|
73
|
+
/** Predicate marking arbitrary dates disabled. */
|
|
74
|
+
isDateDisabled?: (date: ISODate) => boolean;
|
|
75
|
+
/** Weekday of the calendar's first column (`0` = Sunday). */
|
|
76
|
+
weekStartDay?: WeekDay;
|
|
77
|
+
/** BCP-47 locale for the calendar and the display format. */
|
|
78
|
+
locale?: string;
|
|
79
|
+
/** Stretches the field to its container width. */
|
|
80
|
+
fullWidth?: boolean;
|
|
81
|
+
/** Root-level Tailwind class override. */
|
|
82
|
+
sx?: string;
|
|
83
|
+
/** Per-slot `className` overrides. */
|
|
84
|
+
slotProps?: DatePickerSlotProps;
|
|
85
|
+
/** Test id applied to the field root. */
|
|
86
|
+
testId?: string;
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=datePicker.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"datePicker.types.d.ts","sourceRoot":"","sources":["../../../../src/components/DatePicker/datePicker.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAEjE,yDAAyD;AACzD,MAAM,WAAW,mBAAmB;IAClC,IAAI,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9B,KAAK,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/B,YAAY,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACtC,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACjC,UAAU,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACpC,SAAS,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACpC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,eAAe;IAC9B,0DAA0D;IAC1D,IAAI,EAAE,MAAM,CAAC;IACb,qDAAqD;IACrD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,mBAAmB;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,wEAAwE;IACxE,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,gEAAgE;IAChE,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kDAAkD;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4BAA4B;IAC5B,MAAM,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC9B,uEAAuE;IACvE,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC;IAC1C,+BAA+B;IAC/B,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,qDAAqD;IACrD,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACvB,kCAAkC;IAClC,YAAY,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC9B,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,KAAK,IAAI,CAAC;IAC3C,4CAA4C;IAC5C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,0CAA0C;IAC1C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,uCAAuC;IACvC,aAAa,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IACnC,kDAAkD;IAClD,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC;IAC5C,6DAA6D;IAC7D,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,6DAA6D;IAC7D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kDAAkD;IAClD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,0CAA0C;IAC1C,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,sCAAsC;IACtC,SAAS,CAAC,EAAE,mBAAmB,CAAC;IAChC,yCAAyC;IACzC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Slots for `<DatePicker>` — a bridge-integrated date field whose trigger
|
|
3
|
+
* is a `<button>` styled as an input, opening a `<Calendar>` popover.
|
|
4
|
+
*
|
|
5
|
+
* Theme identity: bare neutral / brand token-backed classes only — no
|
|
6
|
+
* `dark:` variants on the neutral palette (the preset CSS-var swap
|
|
7
|
+
* auto-inverts). See `_shared/themeIdentity.test.ts`.
|
|
8
|
+
*/
|
|
9
|
+
export declare const datePickerVariants: import("tailwind-variants").TVReturnType<{
|
|
10
|
+
layout: {
|
|
11
|
+
stacked: {};
|
|
12
|
+
inline: {
|
|
13
|
+
root: string;
|
|
14
|
+
label: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
error: {
|
|
18
|
+
true: {
|
|
19
|
+
trigger: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
fullWidth: {
|
|
23
|
+
true: {
|
|
24
|
+
root: string;
|
|
25
|
+
trigger: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
}, {
|
|
29
|
+
root: string;
|
|
30
|
+
label: string;
|
|
31
|
+
requiredMark: string;
|
|
32
|
+
trigger: string;
|
|
33
|
+
value: string;
|
|
34
|
+
placeholder: string;
|
|
35
|
+
icon: string;
|
|
36
|
+
helperText: string;
|
|
37
|
+
errorText: string;
|
|
38
|
+
}, undefined, {
|
|
39
|
+
layout: {
|
|
40
|
+
stacked: {};
|
|
41
|
+
inline: {
|
|
42
|
+
root: string;
|
|
43
|
+
label: string;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
error: {
|
|
47
|
+
true: {
|
|
48
|
+
trigger: string;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
fullWidth: {
|
|
52
|
+
true: {
|
|
53
|
+
root: string;
|
|
54
|
+
trigger: string;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
}, {
|
|
58
|
+
root: string;
|
|
59
|
+
label: string;
|
|
60
|
+
requiredMark: string;
|
|
61
|
+
trigger: string;
|
|
62
|
+
value: string;
|
|
63
|
+
placeholder: string;
|
|
64
|
+
icon: string;
|
|
65
|
+
helperText: string;
|
|
66
|
+
errorText: string;
|
|
67
|
+
}, import("tailwind-variants").TVReturnType<{
|
|
68
|
+
layout: {
|
|
69
|
+
stacked: {};
|
|
70
|
+
inline: {
|
|
71
|
+
root: string;
|
|
72
|
+
label: string;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
error: {
|
|
76
|
+
true: {
|
|
77
|
+
trigger: string;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
fullWidth: {
|
|
81
|
+
true: {
|
|
82
|
+
root: string;
|
|
83
|
+
trigger: string;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
}, {
|
|
87
|
+
root: string;
|
|
88
|
+
label: string;
|
|
89
|
+
requiredMark: string;
|
|
90
|
+
trigger: string;
|
|
91
|
+
value: string;
|
|
92
|
+
placeholder: string;
|
|
93
|
+
icon: string;
|
|
94
|
+
helperText: string;
|
|
95
|
+
errorText: string;
|
|
96
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
97
|
+
//# sourceMappingURL=datePicker.variants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"datePicker.variants.d.ts","sourceRoot":"","sources":["../../../../src/components/DatePicker/datePicker.variants.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAuC7B,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { DateRangePickerProps } from './dateRangePicker.types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Dashforge TW `<DateRangePicker>` — a form-bound start/end date field.
|
|
4
|
+
*
|
|
5
|
+
* A read-only trigger button paired with a dual-month range calendar popover
|
|
6
|
+
* (Radix Popover), built on the headless `useDateRange` engine. Integrates
|
|
7
|
+
* with the Dashforge form bridge + RBAC.
|
|
8
|
+
*
|
|
9
|
+
* Storage contract: a `{ start, end }` pair of ISO `YYYY-MM-DD` dates —
|
|
10
|
+
* shared with the MUI `@dashforge/ui` `DateRangePicker`.
|
|
11
|
+
*/
|
|
12
|
+
export declare function DateRangePicker(props: DateRangePickerProps): import("react/jsx-runtime").JSX.Element | null;
|
|
13
|
+
//# sourceMappingURL=DateRangePicker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateRangePicker.d.ts","sourceRoot":"","sources":["../../../../src/components/DateRangePicker/DateRangePicker.tsx"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAoQvE;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,kDAoN1D"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { Engine } from '@dashforge/ui-core';
|
|
3
|
+
import type { AccessRequirement } from '@dashforge/rbac';
|
|
4
|
+
import type { DateRange, ISODate, WeekDay } from '@dashforge/calendar-core';
|
|
5
|
+
/** Per-slot `className` overrides for `<DateRangePicker>`. */
|
|
6
|
+
export interface DateRangePickerSlotProps {
|
|
7
|
+
root?: {
|
|
8
|
+
className?: string;
|
|
9
|
+
};
|
|
10
|
+
label?: {
|
|
11
|
+
className?: string;
|
|
12
|
+
};
|
|
13
|
+
requiredMark?: {
|
|
14
|
+
className?: string;
|
|
15
|
+
};
|
|
16
|
+
trigger?: {
|
|
17
|
+
className?: string;
|
|
18
|
+
};
|
|
19
|
+
helperText?: {
|
|
20
|
+
className?: string;
|
|
21
|
+
};
|
|
22
|
+
errorText?: {
|
|
23
|
+
className?: string;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Props for the `<DateRangePicker>` form field (Tailwind skin).
|
|
28
|
+
*
|
|
29
|
+
* A read-only trigger paired with a dual-month range calendar popover. The
|
|
30
|
+
* stored value is a `{ start, end }` pair of plain ISO calendar dates
|
|
31
|
+
* (`YYYY-MM-DD`); either side may be `null`. No time, no timezone.
|
|
32
|
+
*
|
|
33
|
+
* The prop surface mirrors the MUI `@dashforge/ui` `DateRangePicker`.
|
|
34
|
+
*/
|
|
35
|
+
export interface DateRangePickerProps {
|
|
36
|
+
/** Field name — the bridge registration key. Required. */
|
|
37
|
+
name: string;
|
|
38
|
+
/** Validation rules forwarded to the form bridge. */
|
|
39
|
+
rules?: unknown;
|
|
40
|
+
/** Field label. */
|
|
41
|
+
label?: ReactNode;
|
|
42
|
+
/** Helper text below the control (overrides a bridge error message). */
|
|
43
|
+
helperText?: ReactNode;
|
|
44
|
+
/** Explicit error state (overrides the bridge's auto error). */
|
|
45
|
+
error?: boolean;
|
|
46
|
+
/** Marks the field required (adds the label asterisk). */
|
|
47
|
+
required?: boolean;
|
|
48
|
+
/** Disables the field. */
|
|
49
|
+
disabled?: boolean;
|
|
50
|
+
/** Placeholder shown when no range is selected. */
|
|
51
|
+
placeholder?: string;
|
|
52
|
+
/** Label/control layout. */
|
|
53
|
+
layout?: 'stacked' | 'inline';
|
|
54
|
+
/** Reactive visibility predicate evaluated against the form engine. */
|
|
55
|
+
visibleWhen?: (engine: Engine) => boolean;
|
|
56
|
+
/** RBAC access requirement. */
|
|
57
|
+
access?: AccessRequirement;
|
|
58
|
+
/** Controlled value — a `{ start, end }` pair. */
|
|
59
|
+
value?: DateRange;
|
|
60
|
+
/** Uncontrolled initial value. */
|
|
61
|
+
defaultValue?: DateRange;
|
|
62
|
+
/** Fired with the new range (partial on the first click, complete on the second). */
|
|
63
|
+
onChange?: (value: DateRange) => void;
|
|
64
|
+
/** Earliest selectable date (inclusive). */
|
|
65
|
+
minDate?: ISODate;
|
|
66
|
+
/** Latest selectable date (inclusive). */
|
|
67
|
+
maxDate?: ISODate;
|
|
68
|
+
/** Explicit list of disabled dates. */
|
|
69
|
+
disabledDates?: readonly ISODate[];
|
|
70
|
+
/** Predicate marking arbitrary dates disabled. */
|
|
71
|
+
isDateDisabled?: (date: ISODate) => boolean;
|
|
72
|
+
/** Weekday of the calendar's first column (`0` = Sunday). */
|
|
73
|
+
weekStartDay?: WeekDay;
|
|
74
|
+
/** BCP-47 locale for the calendar and the display format. */
|
|
75
|
+
locale?: string;
|
|
76
|
+
/** Stretches the field to its container width. */
|
|
77
|
+
fullWidth?: boolean;
|
|
78
|
+
/** Root-level Tailwind class override. */
|
|
79
|
+
sx?: string;
|
|
80
|
+
/** Per-slot `className` overrides. */
|
|
81
|
+
slotProps?: DateRangePickerSlotProps;
|
|
82
|
+
/** Test id applied to the field root. */
|
|
83
|
+
testId?: string;
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=dateRangePicker.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dateRangePicker.types.d.ts","sourceRoot":"","sources":["../../../../src/components/DateRangePicker/dateRangePicker.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAE5E,8DAA8D;AAC9D,MAAM,WAAW,wBAAwB;IACvC,IAAI,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9B,KAAK,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/B,YAAY,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACtC,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACjC,UAAU,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACpC,SAAS,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACpC;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,oBAAoB;IACnC,0DAA0D;IAC1D,IAAI,EAAE,MAAM,CAAC;IACb,qDAAqD;IACrD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,mBAAmB;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,wEAAwE;IACxE,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,gEAAgE;IAChE,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mDAAmD;IACnD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4BAA4B;IAC5B,MAAM,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC9B,uEAAuE;IACvE,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC;IAC1C,+BAA+B;IAC/B,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,kDAAkD;IAClD,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,kCAAkC;IAClC,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,qFAAqF;IACrF,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;IACtC,4CAA4C;IAC5C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,0CAA0C;IAC1C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,uCAAuC;IACvC,aAAa,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IACnC,kDAAkD;IAClD,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC;IAC5C,6DAA6D;IAC7D,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,6DAA6D;IAC7D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kDAAkD;IAClD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,0CAA0C;IAC1C,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,sCAAsC;IACtC,SAAS,CAAC,EAAE,wBAAwB,CAAC;IACrC,yCAAyC;IACzC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|