@wheelhouse/ui 0.2.0 → 0.2.1
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/blocks/index.d.ts +2 -0
- package/dist/blocks/index.d.ts.map +1 -0
- package/dist/blocks/index.js +1 -0
- package/dist/blocks/navigation/index.d.ts +2 -0
- package/dist/blocks/navigation/index.d.ts.map +1 -0
- package/dist/blocks/navigation/index.js +1 -0
- package/dist/blocks/navigation/pattern-1/index.d.ts +3 -0
- package/dist/blocks/navigation/pattern-1/index.d.ts.map +1 -0
- package/dist/blocks/navigation/pattern-1/index.js +1 -0
- package/dist/blocks/navigation/pattern-1/pattern-1.config.d.ts +47 -0
- package/dist/blocks/navigation/pattern-1/pattern-1.config.d.ts.map +1 -0
- package/dist/blocks/navigation/pattern-1/pattern-1.config.js +55 -0
- package/dist/blocks/navigation/pattern-1/pattern-1.d.ts +7 -0
- package/dist/blocks/navigation/pattern-1/pattern-1.d.ts.map +1 -0
- package/dist/blocks/navigation/pattern-1/pattern-1.js +50 -0
- package/dist/blocks/navigation/pattern-1/pattern-1.stories.d.ts +16 -0
- package/dist/blocks/navigation/pattern-1/pattern-1.stories.d.ts.map +1 -0
- package/dist/blocks/navigation/pattern-1/pattern-1.stories.js +20 -0
- package/dist/components/accordion/accordion.js +2 -2
- package/dist/components/alert/alert.stories.js +4 -4
- package/dist/components/alert-dialog/alert-dialog.stories.js +2 -2
- package/dist/components/badge/badge.d.ts +1 -1
- package/dist/components/breadcrumb/breadcrumb.d.ts.map +1 -1
- package/dist/components/breadcrumb/breadcrumb.js +3 -4
- package/dist/components/button/button.d.ts +2 -2
- package/dist/components/calendar/calendar.d.ts +34 -0
- package/dist/components/calendar/calendar.d.ts.map +1 -0
- package/dist/components/calendar/calendar.js +82 -0
- package/dist/components/calendar/calendar.stories.d.ts +16 -0
- package/dist/components/calendar/calendar.stories.d.ts.map +1 -0
- package/dist/components/calendar/calendar.stories.js +33 -0
- package/dist/components/calendar/index.d.ts +3 -0
- package/dist/components/calendar/index.d.ts.map +1 -0
- package/dist/components/calendar/index.js +1 -0
- package/dist/components/checkbox/checkbox.js +2 -2
- package/dist/components/collapsible/collapsible.stories.js +4 -4
- package/dist/components/combobox/combobox.d.ts.map +1 -1
- package/dist/components/combobox/combobox.js +5 -7
- package/dist/components/command/command.d.ts.map +1 -1
- package/dist/components/command/command.js +3 -4
- package/dist/components/context-menu/context-menu.d.ts.map +1 -1
- package/dist/components/context-menu/context-menu.js +4 -5
- package/dist/components/date-selector/date-selector-context.d.ts +6 -0
- package/dist/components/date-selector/date-selector-context.d.ts.map +1 -0
- package/dist/components/date-selector/date-selector-context.js +11 -0
- package/dist/components/date-selector/date-selector-parts.d.ts +68 -0
- package/dist/components/date-selector/date-selector-parts.d.ts.map +1 -0
- package/dist/components/date-selector/date-selector-parts.js +131 -0
- package/dist/components/date-selector/date-selector-types.d.ts +118 -0
- package/dist/components/date-selector/date-selector-types.d.ts.map +1 -0
- package/dist/components/date-selector/date-selector-types.js +32 -0
- package/dist/components/date-selector/date-selector-value.d.ts +47 -0
- package/dist/components/date-selector/date-selector-value.d.ts.map +1 -0
- package/dist/components/date-selector/date-selector-value.js +183 -0
- package/dist/components/date-selector/date-selector.d.ts +6 -0
- package/dist/components/date-selector/date-selector.d.ts.map +1 -0
- package/dist/components/date-selector/date-selector.js +144 -0
- package/dist/components/date-selector/date-selector.stories.d.ts +135 -0
- package/dist/components/date-selector/date-selector.stories.d.ts.map +1 -0
- package/dist/components/date-selector/date-selector.stories.js +144 -0
- package/dist/components/date-selector/index.d.ts +7 -0
- package/dist/components/date-selector/index.d.ts.map +1 -0
- package/dist/components/date-selector/index.js +5 -0
- package/dist/components/date-selector/use-date-selector.d.ts +50 -0
- package/dist/components/date-selector/use-date-selector.d.ts.map +1 -0
- package/dist/components/date-selector/use-date-selector.js +305 -0
- package/dist/components/dialog/dialog.js +2 -2
- package/dist/components/dropdown-menu/dropdown-menu.d.ts.map +1 -1
- package/dist/components/dropdown-menu/dropdown-menu.js +5 -6
- package/dist/components/empty/empty.stories.js +2 -2
- package/dist/components/filters/filters.js +4 -4
- package/dist/components/filters/filters.stories.js +3 -3
- package/dist/components/frame/frame.d.ts +1 -1
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +4 -0
- package/dist/components/input-group/input-group.d.ts +2 -2
- package/dist/components/input-group/input-group.stories.js +3 -3
- package/dist/components/item/item.d.ts +2 -2
- package/dist/components/item/item.stories.d.ts.map +1 -1
- package/dist/components/item/item.stories.js +5 -6
- package/dist/components/kbd/kbd.stories.js +2 -2
- package/dist/components/menubar/menubar.js +3 -3
- package/dist/components/native-select/native-select.js +2 -2
- package/dist/components/navigation-menu/navigation-menu.js +2 -2
- package/dist/components/pagination/pagination.js +4 -4
- package/dist/components/select/select.js +5 -5
- package/dist/components/sheet/sheet.js +2 -2
- package/dist/components/sonner/sonner.d.ts +1 -1
- package/dist/components/sonner/sonner.js +7 -7
- package/dist/components/sortable/index.d.ts +3 -0
- package/dist/components/sortable/index.d.ts.map +1 -0
- package/dist/components/sortable/index.js +1 -0
- package/dist/components/sortable/sortable.d.ts +94 -0
- package/dist/components/sortable/sortable.d.ts.map +1 -0
- package/dist/components/sortable/sortable.js +210 -0
- package/dist/components/sortable/sortable.stories.d.ts +14 -0
- package/dist/components/sortable/sortable.stories.d.ts.map +1 -0
- package/dist/components/sortable/sortable.stories.js +38 -0
- package/dist/components/spinner/spinner.d.ts +3 -3
- package/dist/components/spinner/spinner.d.ts.map +1 -1
- package/dist/components/spinner/spinner.js +2 -2
- package/dist/components/status-indicator/index.d.ts +3 -0
- package/dist/components/status-indicator/index.d.ts.map +1 -0
- package/dist/components/status-indicator/index.js +1 -0
- package/dist/components/status-indicator/status-indicator.d.ts +51 -0
- package/dist/components/status-indicator/status-indicator.d.ts.map +1 -0
- package/dist/components/status-indicator/status-indicator.js +48 -0
- package/dist/components/status-indicator/status-indicator.stories.d.ts +20 -0
- package/dist/components/status-indicator/status-indicator.stories.d.ts.map +1 -0
- package/dist/components/status-indicator/status-indicator.stories.js +97 -0
- package/dist/components/tabs/tabs.d.ts +1 -1
- package/dist/components/text/text.d.ts +1 -1
- package/dist/components/text/text.js +1 -1
- package/dist/hooks/use-mobile.d.ts +2 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -0
- package/dist/hooks/use-mobile.js +15 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/llms.txt +11 -4
- package/package.json +9 -6
- package/src/styles/globals.css +4 -12
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type DateSelectorFilterType, type DateSelectorI18nConfig, type DateSelectorPeriodType, type DateSelectorRollingDays, type DateSelectorSelectionMode, type DateSelectorValue } from './date-selector-types';
|
|
2
|
+
/**
|
|
3
|
+
* Computes inclusive calendar date bounds for rolling windows. “Next N” includes today and spans N calendar days.
|
|
4
|
+
* “Last N” includes today and goes back N − 1 days before today (N days total).
|
|
5
|
+
*/
|
|
6
|
+
export declare function computeRollingDateRange(mode: 'rolling-next' | 'rolling-last', days: number, now?: Date): {
|
|
7
|
+
startDate: Date;
|
|
8
|
+
endDate: Date;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Formats a {@link DateSelectorValue} for display using the same rules as the selector’s summary text.
|
|
12
|
+
*/
|
|
13
|
+
export declare function formatDateValue(value: DateSelectorValue, i18n?: DateSelectorI18nConfig, dayDateFormat?: string): string;
|
|
14
|
+
/** Stable fingerprint for a {@link DateSelectorValue} (for sync keys and onChange deduplication). */
|
|
15
|
+
export declare function dateSelectorDataKey(value: DateSelectorValue | undefined): string;
|
|
16
|
+
export declare function computeStateSyncKey(value: DateSelectorValue | undefined, presetMode: DateSelectorFilterType | undefined, defaultFilterType: DateSelectorFilterType, validDefaultPeriodType: DateSelectorPeriodType): string;
|
|
17
|
+
/** Full local UI state for {@link useDateSelector} (calendar month / hover are not part of {@link DateSelectorValue}). */
|
|
18
|
+
export interface DateSelectorInternalState {
|
|
19
|
+
periodType: DateSelectorPeriodType;
|
|
20
|
+
filterType: DateSelectorFilterType;
|
|
21
|
+
selectedDate: Date | undefined;
|
|
22
|
+
selectedEndDate: Date | undefined;
|
|
23
|
+
calendarMonth: Date;
|
|
24
|
+
selectedYear: number | undefined;
|
|
25
|
+
selectedMonth: number | undefined;
|
|
26
|
+
selectedQuarter: number | undefined;
|
|
27
|
+
rangeStart: {
|
|
28
|
+
year: number;
|
|
29
|
+
value: number;
|
|
30
|
+
} | undefined;
|
|
31
|
+
rangeEnd: {
|
|
32
|
+
year: number;
|
|
33
|
+
value: number;
|
|
34
|
+
} | undefined;
|
|
35
|
+
hoverDate: Date | undefined;
|
|
36
|
+
selectionMode: DateSelectorSelectionMode;
|
|
37
|
+
rollingDays: DateSelectorRollingDays | undefined;
|
|
38
|
+
}
|
|
39
|
+
export declare function createInitialInternalState(value: DateSelectorValue | undefined, validDefaultPeriodType: DateSelectorPeriodType, defaultFilterType: DateSelectorFilterType, presetMode: DateSelectorFilterType | undefined): DateSelectorInternalState;
|
|
40
|
+
export declare function buildRollingValueFromState(selectionMode: DateSelectorSelectionMode, rollingDays: DateSelectorRollingDays | undefined): DateSelectorValue | undefined;
|
|
41
|
+
export declare function buildCurrentValueFromInternal(s: DateSelectorInternalState, presetMode: DateSelectorFilterType | undefined): DateSelectorValue;
|
|
42
|
+
/** Combined UI state + last emitted value fingerprint for `onChange` deduplication. */
|
|
43
|
+
export interface DateSelectorHookState {
|
|
44
|
+
internal: DateSelectorInternalState;
|
|
45
|
+
lastEmittedDataKey: string;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=date-selector-value.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-selector-value.d.ts","sourceRoot":"","sources":["../../../src/components/date-selector/date-selector-value.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EAEzB,MAAM,uBAAuB,CAAC;AAE/B;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,cAAc,GAAG,cAAc,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,GAAE,IAAiB,GAAG;IAAE,SAAS,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,IAAI,CAAA;CAAE,CAYvJ;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC3B,KAAK,EAAE,iBAAiB,EACxB,IAAI,GAAE,sBAAmD,EACzD,aAAa,GAAE,MAAqB,GACrC,MAAM,CAuDR;AAED,qGAAqG;AACrG,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,iBAAiB,GAAG,SAAS,GAAG,MAAM,CAgBhF;AAED,wBAAgB,mBAAmB,CAC/B,KAAK,EAAE,iBAAiB,GAAG,SAAS,EACpC,UAAU,EAAE,sBAAsB,GAAG,SAAS,EAC9C,iBAAiB,EAAE,sBAAsB,EACzC,sBAAsB,EAAE,sBAAsB,GAC/C,MAAM,CAER;AAED,0HAA0H;AAC1H,MAAM,WAAW,yBAAyB;IACtC,UAAU,EAAE,sBAAsB,CAAC;IACnC,UAAU,EAAE,sBAAsB,CAAC;IACnC,YAAY,EAAE,IAAI,GAAG,SAAS,CAAC;IAC/B,eAAe,EAAE,IAAI,GAAG,SAAS,CAAC;IAClC,aAAa,EAAE,IAAI,CAAC;IACpB,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,UAAU,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC;IACxD,QAAQ,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC;IACtD,SAAS,EAAE,IAAI,GAAG,SAAS,CAAC;IAC5B,aAAa,EAAE,yBAAyB,CAAC;IACzC,WAAW,EAAE,uBAAuB,GAAG,SAAS,CAAC;CACpD;AAED,wBAAgB,0BAA0B,CACtC,KAAK,EAAE,iBAAiB,GAAG,SAAS,EACpC,sBAAsB,EAAE,sBAAsB,EAC9C,iBAAiB,EAAE,sBAAsB,EACzC,UAAU,EAAE,sBAAsB,GAAG,SAAS,GAC/C,yBAAyB,CAoD3B;AAED,wBAAgB,0BAA0B,CACtC,aAAa,EAAE,yBAAyB,EACxC,WAAW,EAAE,uBAAuB,GAAG,SAAS,GACjD,iBAAiB,GAAG,SAAS,CAoB/B;AAED,wBAAgB,6BAA6B,CAAC,CAAC,EAAE,yBAAyB,EAAE,UAAU,EAAE,sBAAsB,GAAG,SAAS,GAAG,iBAAiB,CAc7I;AAED,uFAAuF;AACvF,MAAM,WAAW,qBAAqB;IAClC,QAAQ,EAAE,yBAAyB,CAAC;IACpC,kBAAkB,EAAE,MAAM,CAAC;CAC9B"}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { addDays, format, startOfDay, subDays } from 'date-fns';
|
|
2
|
+
import { DEFAULT_DATE_SELECTOR_I18N, } from './date-selector-types';
|
|
3
|
+
/**
|
|
4
|
+
* Computes inclusive calendar date bounds for rolling windows. “Next N” includes today and spans N calendar days.
|
|
5
|
+
* “Last N” includes today and goes back N − 1 days before today (N days total).
|
|
6
|
+
*/
|
|
7
|
+
export function computeRollingDateRange(mode, days, now = new Date()) {
|
|
8
|
+
const today = startOfDay(now);
|
|
9
|
+
if (mode === 'rolling-next') {
|
|
10
|
+
return {
|
|
11
|
+
startDate: today,
|
|
12
|
+
endDate: startOfDay(addDays(today, days - 1)),
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
return {
|
|
16
|
+
startDate: startOfDay(subDays(today, days - 1)),
|
|
17
|
+
endDate: today,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Formats a {@link DateSelectorValue} for display using the same rules as the selector’s summary text.
|
|
22
|
+
*/
|
|
23
|
+
export function formatDateValue(value, i18n = DEFAULT_DATE_SELECTOR_I18N, dayDateFormat = 'MM/dd/yyyy') {
|
|
24
|
+
const { period, selectionMode, rollingDays, startDate, endDate, year, month, quarter, rangeStart, rangeEnd } = value;
|
|
25
|
+
if ((selectionMode === 'rolling-next' || selectionMode === 'rolling-last') && rollingDays !== undefined) {
|
|
26
|
+
const label = selectionMode === 'rolling-next'
|
|
27
|
+
? i18n.rollingSummaryNext.replace('{{count}}', String(rollingDays))
|
|
28
|
+
: i18n.rollingSummaryLast.replace('{{count}}', String(rollingDays));
|
|
29
|
+
if (startDate && endDate) {
|
|
30
|
+
return `${label} (${format(startDate, dayDateFormat)} – ${format(endDate, dayDateFormat)})`;
|
|
31
|
+
}
|
|
32
|
+
return label;
|
|
33
|
+
}
|
|
34
|
+
if (period === 'day') {
|
|
35
|
+
if (startDate && endDate) {
|
|
36
|
+
return `${format(startDate, dayDateFormat)} - ${format(endDate, dayDateFormat)}`;
|
|
37
|
+
}
|
|
38
|
+
if (startDate) {
|
|
39
|
+
return format(startDate, dayDateFormat);
|
|
40
|
+
}
|
|
41
|
+
return '';
|
|
42
|
+
}
|
|
43
|
+
if (period === 'month') {
|
|
44
|
+
if (rangeStart && rangeEnd) {
|
|
45
|
+
return `${i18n.monthsShort[rangeStart.value]} ${rangeStart.year} - ${i18n.monthsShort[rangeEnd.value]} ${rangeEnd.year}`;
|
|
46
|
+
}
|
|
47
|
+
if (year !== undefined && month !== undefined) {
|
|
48
|
+
return `${i18n.monthsShort[month]} ${year}`;
|
|
49
|
+
}
|
|
50
|
+
return '';
|
|
51
|
+
}
|
|
52
|
+
if (period === 'quarter') {
|
|
53
|
+
if (rangeStart && rangeEnd) {
|
|
54
|
+
return `${i18n.quarters[rangeStart.value]} ${rangeStart.year} - ${i18n.quarters[rangeEnd.value]} ${rangeEnd.year}`;
|
|
55
|
+
}
|
|
56
|
+
if (year !== undefined && quarter !== undefined) {
|
|
57
|
+
return `${i18n.quarters[quarter]} ${year}`;
|
|
58
|
+
}
|
|
59
|
+
return '';
|
|
60
|
+
}
|
|
61
|
+
if (period === 'year') {
|
|
62
|
+
if (rangeStart && rangeEnd) {
|
|
63
|
+
return `${rangeStart.year} - ${rangeEnd.year}`;
|
|
64
|
+
}
|
|
65
|
+
if (year !== undefined) {
|
|
66
|
+
return `${year}`;
|
|
67
|
+
}
|
|
68
|
+
return '';
|
|
69
|
+
}
|
|
70
|
+
return '';
|
|
71
|
+
}
|
|
72
|
+
/** Stable fingerprint for a {@link DateSelectorValue} (for sync keys and onChange deduplication). */
|
|
73
|
+
export function dateSelectorDataKey(value) {
|
|
74
|
+
if (value === undefined)
|
|
75
|
+
return '__uc__';
|
|
76
|
+
const v = value;
|
|
77
|
+
return [
|
|
78
|
+
v.period,
|
|
79
|
+
v.operator,
|
|
80
|
+
v.selectionMode ?? '',
|
|
81
|
+
v.rollingDays ?? '',
|
|
82
|
+
v.year ?? '',
|
|
83
|
+
v.month ?? '',
|
|
84
|
+
v.quarter ?? '',
|
|
85
|
+
v.startDate?.getTime() ?? '',
|
|
86
|
+
v.endDate?.getTime() ?? '',
|
|
87
|
+
v.rangeStart ? `${v.rangeStart.year}-${v.rangeStart.value}` : '',
|
|
88
|
+
v.rangeEnd ? `${v.rangeEnd.year}-${v.rangeEnd.value}` : '',
|
|
89
|
+
].join('|');
|
|
90
|
+
}
|
|
91
|
+
export function computeStateSyncKey(value, presetMode, defaultFilterType, validDefaultPeriodType) {
|
|
92
|
+
return `${dateSelectorDataKey(value)}|${presetMode ?? ''}|${defaultFilterType}|${validDefaultPeriodType}`;
|
|
93
|
+
}
|
|
94
|
+
export function createInitialInternalState(value, validDefaultPeriodType, defaultFilterType, presetMode) {
|
|
95
|
+
const calendarMonth = value?.startDate ?? new Date();
|
|
96
|
+
if (!value) {
|
|
97
|
+
return {
|
|
98
|
+
periodType: validDefaultPeriodType,
|
|
99
|
+
filterType: presetMode ?? defaultFilterType,
|
|
100
|
+
selectedDate: undefined,
|
|
101
|
+
selectedEndDate: undefined,
|
|
102
|
+
calendarMonth,
|
|
103
|
+
selectedYear: undefined,
|
|
104
|
+
selectedMonth: undefined,
|
|
105
|
+
selectedQuarter: undefined,
|
|
106
|
+
rangeStart: undefined,
|
|
107
|
+
rangeEnd: undefined,
|
|
108
|
+
hoverDate: undefined,
|
|
109
|
+
selectionMode: 'custom',
|
|
110
|
+
rollingDays: undefined,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
const filterType = presetMode ?? value.operator ?? defaultFilterType;
|
|
114
|
+
if (value.selectionMode === 'rolling-next' || value.selectionMode === 'rolling-last') {
|
|
115
|
+
return {
|
|
116
|
+
periodType: value.period || validDefaultPeriodType,
|
|
117
|
+
filterType,
|
|
118
|
+
selectedDate: undefined,
|
|
119
|
+
selectedEndDate: undefined,
|
|
120
|
+
calendarMonth,
|
|
121
|
+
selectedYear: value.year,
|
|
122
|
+
selectedMonth: value.month,
|
|
123
|
+
selectedQuarter: value.quarter,
|
|
124
|
+
rangeStart: value.rangeStart,
|
|
125
|
+
rangeEnd: value.rangeEnd,
|
|
126
|
+
hoverDate: undefined,
|
|
127
|
+
selectionMode: value.selectionMode,
|
|
128
|
+
rollingDays: value.rollingDays,
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
return {
|
|
132
|
+
periodType: value.period || validDefaultPeriodType,
|
|
133
|
+
filterType,
|
|
134
|
+
selectedYear: value.year,
|
|
135
|
+
selectedMonth: value.month,
|
|
136
|
+
selectedQuarter: value.quarter,
|
|
137
|
+
rangeStart: value.rangeStart,
|
|
138
|
+
rangeEnd: value.rangeEnd,
|
|
139
|
+
hoverDate: undefined,
|
|
140
|
+
selectionMode: 'custom',
|
|
141
|
+
rollingDays: undefined,
|
|
142
|
+
selectedDate: value.startDate,
|
|
143
|
+
selectedEndDate: value.endDate,
|
|
144
|
+
calendarMonth,
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
export function buildRollingValueFromState(selectionMode, rollingDays) {
|
|
148
|
+
if (selectionMode !== 'rolling-next' && selectionMode !== 'rolling-last') {
|
|
149
|
+
return undefined;
|
|
150
|
+
}
|
|
151
|
+
if (rollingDays === undefined) {
|
|
152
|
+
return {
|
|
153
|
+
period: 'day',
|
|
154
|
+
operator: 'between',
|
|
155
|
+
selectionMode,
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
const { startDate: rs, endDate: re } = computeRollingDateRange(selectionMode === 'rolling-next' ? 'rolling-next' : 'rolling-last', rollingDays, new Date());
|
|
159
|
+
return {
|
|
160
|
+
period: 'day',
|
|
161
|
+
operator: 'between',
|
|
162
|
+
selectionMode,
|
|
163
|
+
rollingDays,
|
|
164
|
+
startDate: rs,
|
|
165
|
+
endDate: re,
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
export function buildCurrentValueFromInternal(s, presetMode) {
|
|
169
|
+
const rolling = buildRollingValueFromState(s.selectionMode, s.rollingDays);
|
|
170
|
+
if (rolling)
|
|
171
|
+
return rolling;
|
|
172
|
+
return {
|
|
173
|
+
period: s.periodType,
|
|
174
|
+
operator: presetMode ?? s.filterType,
|
|
175
|
+
startDate: s.selectedDate,
|
|
176
|
+
endDate: s.selectedEndDate,
|
|
177
|
+
year: s.selectedYear,
|
|
178
|
+
month: s.selectedMonth,
|
|
179
|
+
quarter: s.selectedQuarter,
|
|
180
|
+
rangeStart: s.rangeStart,
|
|
181
|
+
rangeEnd: s.rangeEnd,
|
|
182
|
+
};
|
|
183
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type DateSelectorProps } from './date-selector-types';
|
|
2
|
+
/**
|
|
3
|
+
* Composite filter control for dates and calendar periods. Root element sets `data-slot="date-selector"`.
|
|
4
|
+
*/
|
|
5
|
+
export declare function DateSelector({ value, onChange, allowRange, periodTypes, defaultPeriodType, defaultFilterType, presetMode, showInput, showOperators, showTwoMonths, label, className, yearRange, baseYear, minYear, maxYear, yearOptions, i18n: i18nOverride, inputHint, dayDateFormat, dayDateFormats, weekStartsOn, showRollingPresets, rollingDayOptions, }: DateSelectorProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
//# sourceMappingURL=date-selector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-selector.d.ts","sourceRoot":"","sources":["../../../src/components/date-selector/date-selector.tsx"],"names":[],"mappings":"AAsBA,OAAO,EAAqC,KAAK,iBAAiB,EAAsD,MAAM,uBAAuB,CAAC;AAItJ;;GAEG;AACH,wBAAgB,YAAY,CAAC,EACzB,KAAK,EACL,QAAQ,EACR,UAAiB,EACjB,WAAW,EACX,iBAAyB,EACzB,iBAAwB,EACxB,UAAU,EACV,SAAgB,EAChB,aAAoB,EACpB,aAAqB,EACrB,KAAK,EACL,SAAS,EACT,SAAa,EACb,QAAQ,EACR,OAAc,EACd,OAAc,EACd,WAAW,EACX,IAAI,EAAE,YAAY,EAClB,SAAS,EACT,aAA4B,EAC5B,cAAc,EACd,YAAY,EACZ,kBAA0B,EAC1B,iBAAqD,GACxD,EAAE,iBAAiB,2CA6TnB"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* Rich date / period filter: day through year granularity, filter operators (is / before / after / between), optional free-text input,
|
|
5
|
+
* and shared state via {@link useDateSelector}. Built on `Calendar`, tabs, and `ScrollArea`.
|
|
6
|
+
*
|
|
7
|
+
* Implementation is split across `date-selector-types`, `date-selector-value`, `use-date-selector`, `date-selector-context`,
|
|
8
|
+
* and `date-selector-parts` for maintainability.
|
|
9
|
+
*/
|
|
10
|
+
import { useCallback, useMemo, useState } from 'react';
|
|
11
|
+
import { parse } from 'date-fns';
|
|
12
|
+
import { cn } from '../../lib/utils';
|
|
13
|
+
import { Button } from '../button';
|
|
14
|
+
import { Input } from '../input';
|
|
15
|
+
import { ScrollArea } from '../scroll-area';
|
|
16
|
+
import { Tabs, TabsList, TabsTrigger } from '../tabs';
|
|
17
|
+
import { X } from 'lucide-react';
|
|
18
|
+
import { DateSelectorContext } from './date-selector-context';
|
|
19
|
+
import { DateSelectorDayPicker, DateSelectorFilterToggle, DateSelectorPeriodGrid, DateSelectorPeriodTabs, DateSelectorYearList } from './date-selector-parts';
|
|
20
|
+
import { DATE_SELECTOR_ROLLING_DAY_OPTIONS, DEFAULT_DATE_SELECTOR_I18N } from './date-selector-types';
|
|
21
|
+
import { formatDateValue } from './date-selector-value';
|
|
22
|
+
import { useDateSelector } from './use-date-selector';
|
|
23
|
+
/**
|
|
24
|
+
* Composite filter control for dates and calendar periods. Root element sets `data-slot="date-selector"`.
|
|
25
|
+
*/
|
|
26
|
+
export function DateSelector({ value, onChange, allowRange = true, periodTypes, defaultPeriodType = 'day', defaultFilterType = 'is', presetMode, showInput = true, showOperators = true, showTwoMonths = false, label, className, yearRange = 5, baseYear, minYear = 2024, maxYear = 2028, yearOptions, i18n: i18nOverride, inputHint, dayDateFormat = 'MM/dd/yyyy', dayDateFormats, weekStartsOn, showRollingPresets = false, rollingDayOptions = DATE_SELECTOR_ROLLING_DAY_OPTIONS, }) {
|
|
27
|
+
const mergedI18n = useMemo(() => ({ ...DEFAULT_DATE_SELECTOR_I18N, ...i18nOverride }), [i18nOverride]);
|
|
28
|
+
const selector = useDateSelector({
|
|
29
|
+
value,
|
|
30
|
+
onChange,
|
|
31
|
+
defaultPeriodType,
|
|
32
|
+
defaultFilterType,
|
|
33
|
+
presetMode,
|
|
34
|
+
allowRange,
|
|
35
|
+
yearRange,
|
|
36
|
+
baseYear,
|
|
37
|
+
minYear,
|
|
38
|
+
maxYear,
|
|
39
|
+
yearOptions,
|
|
40
|
+
periodTypes,
|
|
41
|
+
});
|
|
42
|
+
const { periodType, filterType, selectedDate, selectedEndDate, calendarMonth, selectedYear, selectedMonth, selectedQuarter, rangeStart, rangeEnd, hoverDate, years, currentValue, setPeriodType, setFilterType, setCalendarMonth, setHoverDate, clearSelection, handleDayClick, handlePeriodSelect, handleYearSelect, isInRange, isYearInRange, selectionMode, rollingDays, applyRollingPreset, enterCustomRange, syncInternalFromParsedValue, } = selector;
|
|
43
|
+
const defaultRollingDay = useMemo(() => {
|
|
44
|
+
if (rollingDays !== undefined && rollingDayOptions.includes(rollingDays))
|
|
45
|
+
return rollingDays;
|
|
46
|
+
return rollingDayOptions[0];
|
|
47
|
+
}, [rollingDays, rollingDayOptions]);
|
|
48
|
+
const hideOperatorsForRolling = showRollingPresets && periodType === 'day' && (selectionMode === 'rolling-next' || selectionMode === 'rolling-last');
|
|
49
|
+
const showDayCalendar = periodType === 'day' && selectionMode === 'custom';
|
|
50
|
+
const displayValue = formatDateValue(currentValue, mergedI18n, dayDateFormat);
|
|
51
|
+
const [draftInput, setDraftInput] = useState('');
|
|
52
|
+
const [isInputFocused, setIsInputFocused] = useState(false);
|
|
53
|
+
const summaryInputValue = inputHint ? (isInputFocused ? draftInput : displayValue) : displayValue;
|
|
54
|
+
const dateFormats = useMemo(() => {
|
|
55
|
+
if (dayDateFormats && dayDateFormats.length > 0) {
|
|
56
|
+
const formats = [...dayDateFormats];
|
|
57
|
+
if (!formats.includes(dayDateFormat)) {
|
|
58
|
+
formats.unshift(dayDateFormat);
|
|
59
|
+
}
|
|
60
|
+
return formats;
|
|
61
|
+
}
|
|
62
|
+
const defaultFormats = [dayDateFormat, 'dd/MM/yyyy', 'yyyy-MM-dd', 'MM-dd-yyyy', 'dd-MM-yyyy'];
|
|
63
|
+
return Array.from(new Set(defaultFormats));
|
|
64
|
+
}, [dayDateFormat, dayDateFormats]);
|
|
65
|
+
const parseInputValue = useCallback((text) => {
|
|
66
|
+
if (!text.trim())
|
|
67
|
+
return null;
|
|
68
|
+
const trimmed = text.trim();
|
|
69
|
+
const yearMatch = trimmed.match(/^\d{4}$/);
|
|
70
|
+
if (yearMatch) {
|
|
71
|
+
const year = parseInt(yearMatch[0]);
|
|
72
|
+
if (year >= 1900 && year <= 2100) {
|
|
73
|
+
return {
|
|
74
|
+
period: 'year',
|
|
75
|
+
operator: presetMode ?? filterType,
|
|
76
|
+
year,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
const quarterMatch = trimmed.match(/^Q([1-4])(?:\s+(\d{4}))?$/i);
|
|
81
|
+
if (quarterMatch) {
|
|
82
|
+
const quarter = parseInt(quarterMatch[1]) - 1;
|
|
83
|
+
const year = quarterMatch[2] ? parseInt(quarterMatch[2]) : new Date().getFullYear();
|
|
84
|
+
if (year >= 1900 && year <= 2100) {
|
|
85
|
+
return {
|
|
86
|
+
period: 'quarter',
|
|
87
|
+
operator: presetMode ?? filterType,
|
|
88
|
+
year,
|
|
89
|
+
quarter,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
for (const dateFormat of dateFormats) {
|
|
94
|
+
try {
|
|
95
|
+
const parsed = parse(trimmed, dateFormat, new Date());
|
|
96
|
+
if (!isNaN(parsed.getTime())) {
|
|
97
|
+
return {
|
|
98
|
+
period: 'day',
|
|
99
|
+
operator: presetMode ?? filterType,
|
|
100
|
+
startDate: parsed,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
catch {
|
|
105
|
+
// Continue to next format
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return null;
|
|
109
|
+
}, [filterType, presetMode, dateFormats]);
|
|
110
|
+
const handleInputChange = useCallback((e) => {
|
|
111
|
+
const newValue = e.target.value;
|
|
112
|
+
setDraftInput(newValue);
|
|
113
|
+
const parsed = parseInputValue(newValue);
|
|
114
|
+
if (parsed) {
|
|
115
|
+
onChange?.(parsed);
|
|
116
|
+
if (value === undefined) {
|
|
117
|
+
syncInternalFromParsedValue(parsed);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}, [onChange, parseInputValue, syncInternalFromParsedValue, value]);
|
|
121
|
+
const handleInputBlur = useCallback(() => {
|
|
122
|
+
setIsInputFocused(false);
|
|
123
|
+
if (!parseInputValue(draftInput)) {
|
|
124
|
+
setDraftInput(displayValue);
|
|
125
|
+
}
|
|
126
|
+
}, [draftInput, displayValue, parseInputValue]);
|
|
127
|
+
const summaryInput = showInput ? (_jsxs("div", { className: "relative", "data-slot": "date-selector-summary-input", children: [_jsx(Input, { type: "text", value: summaryInputValue, readOnly: !inputHint, placeholder: isInputFocused && inputHint ? inputHint : mergedI18n.placeholder, onFocus: () => {
|
|
128
|
+
setIsInputFocused(true);
|
|
129
|
+
setDraftInput(displayValue);
|
|
130
|
+
}, onBlur: handleInputBlur, onChange: handleInputChange }), summaryInputValue && (_jsx("button", { type: "button", onClick: clearSelection, className: cn('absolute end-2.5 top-1/2 size-4 -translate-y-1/2 cursor-pointer rounded-xs', 'opacity-70 transition-opacity hover:opacity-100', 'ring-offset-background focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-none'), children: _jsx(X, { className: "size-4" }) }))] })) : null;
|
|
131
|
+
return (_jsx(DateSelectorContext.Provider, { value: { i18n: mergedI18n, variant: 'outline', size: 'default' }, children: _jsxs("div", { "data-slot": "date-selector", className: cn('w-full max-w-[20rem] space-y-4', className), children: [label && (_jsx("h3", { className: "text-sm font-medium", "data-slot": "data-selector-label", children: label })), showRollingPresets && (_jsxs("div", { className: "space-y-2", "data-slot": "date-selector-rolling", children: [_jsx(Tabs, { className: "w-full", value: selectionMode === 'rolling-next' ? 'rolling-next' : selectionMode === 'rolling-last' ? 'rolling-last' : 'custom', onValueChange: (newValue) => {
|
|
132
|
+
if (!newValue)
|
|
133
|
+
return;
|
|
134
|
+
if (newValue === 'rolling-next')
|
|
135
|
+
applyRollingPreset('rolling-next', defaultRollingDay);
|
|
136
|
+
else if (newValue === 'rolling-last')
|
|
137
|
+
applyRollingPreset('rolling-last', defaultRollingDay);
|
|
138
|
+
else if (newValue === 'custom')
|
|
139
|
+
enterCustomRange();
|
|
140
|
+
}, children: _jsxs(TabsList, { className: "flex h-9 w-full min-w-0 gap-1 bg-muted/80 p-[3px]", children: [_jsx(TabsTrigger, { value: "rolling-next", "aria-label": mergedI18n.rollingWindowTabs.next, className: "min-w-0 flex-1 px-2 py-1 text-center font-normal", children: mergedI18n.rollingWindowTabs.next }), _jsx(TabsTrigger, { value: "rolling-last", "aria-label": mergedI18n.rollingWindowTabs.last, className: "min-w-0 flex-1 px-2 py-1 text-center font-normal", children: mergedI18n.rollingWindowTabs.last }), _jsx(TabsTrigger, { value: "custom", "aria-label": mergedI18n.rollingWindowTabs.custom, className: "min-w-0 flex-1 px-2 py-1 text-center font-normal", children: mergedI18n.rollingWindowTabs.custom })] }) }), showInput && summaryInput, (selectionMode === 'rolling-next' || selectionMode === 'rolling-last') && (_jsx("div", { className: "grid grid-cols-3 gap-2", "data-slot": "date-selector-rolling-value", children: rollingDayOptions.map((d) => {
|
|
141
|
+
const chipLabel = mergedI18n.rollingDaysChip.replace('{{count}}', String(d));
|
|
142
|
+
return (_jsx(Button, { type: "button", size: "sm", className: "w-full min-w-0", variant: rollingDays === d ? 'default' : 'outline', onClick: () => applyRollingPreset(selectionMode === 'rolling-last' ? 'rolling-last' : 'rolling-next', d), children: chipLabel }, d));
|
|
143
|
+
}) }))] })), showOperators && !hideOperatorsForRolling && (_jsx(DateSelectorFilterToggle, { value: filterType, onChange: setFilterType, showBetween: allowRange, presetMode: presetMode })), showInput && !showRollingPresets && summaryInput, (!showRollingPresets || selectionMode === 'custom') && (_jsx(DateSelectorPeriodTabs, { value: periodType, onChange: setPeriodType, periodTypes: periodTypes })), periodType === 'day' && showDayCalendar && (_jsx("div", { className: "w-full pb-1", children: _jsx(DateSelectorDayPicker, { currentMonth: calendarMonth, selectedDate: selectedDate, selectedEndDate: selectedEndDate, onDayClick: handleDayClick, isRange: filterType === 'between' && allowRange, onDayHover: setHoverDate, hoverDate: hoverDate, showTwoMonths: showTwoMonths, weekStartsOn: weekStartsOn, onMonthChange: setCalendarMonth }) })), periodType !== 'day' && (_jsx("div", { className: "-mr-3 w-full", children: _jsxs(ScrollArea, { className: "h-[200px] w-full pe-3", children: [periodType === 'month' && (_jsx(DateSelectorPeriodGrid, { years: years, items: mergedI18n.monthsShort, selectedYear: selectedYear, selectedValue: selectedMonth, rangeStart: rangeStart, rangeEnd: rangeEnd, isInRange: isInRange, onSelect: handlePeriodSelect, columns: 3 })), periodType === 'quarter' && (_jsx(DateSelectorPeriodGrid, { className: "space-y-3", years: years, items: mergedI18n.quarters, selectedYear: selectedYear, selectedValue: selectedQuarter, rangeStart: rangeStart, rangeEnd: rangeEnd, isInRange: isInRange, onSelect: handlePeriodSelect, columns: 4 })), periodType === 'year' && (_jsx(DateSelectorYearList, { years: years, selectedYear: selectedYear, rangeStart: rangeStart, rangeEnd: rangeEnd, isYearInRange: isYearInRange, onSelect: handleYearSelect }))] }, periodType) }))] }) }));
|
|
144
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
import type { DateSelectorFilterType, DateSelectorProps } from '.';
|
|
3
|
+
declare const PERIOD_TYPE_PRESETS: {
|
|
4
|
+
readonly all: undefined;
|
|
5
|
+
readonly day: ["day"];
|
|
6
|
+
readonly 'day-month': ["day", "month"];
|
|
7
|
+
readonly month: ["month"];
|
|
8
|
+
readonly quarter: ["quarter"];
|
|
9
|
+
readonly year: ["year"];
|
|
10
|
+
};
|
|
11
|
+
type PeriodTypesPreset = keyof typeof PERIOD_TYPE_PRESETS;
|
|
12
|
+
/** Story-only controls; mapped to {@link DateSelectorProps} in {@link storyArgsToProps}. */
|
|
13
|
+
type DateSelectorStoryArgs = Omit<Partial<DateSelectorProps>, 'value' | 'onChange' | 'periodTypes' | 'presetMode' | 'weekStartsOn'> & {
|
|
14
|
+
periodTypesPreset?: PeriodTypesPreset;
|
|
15
|
+
presetMode?: DateSelectorFilterType | 'unset';
|
|
16
|
+
weekStartsOn?: 'unset' | NonNullable<DateSelectorProps['weekStartsOn']>;
|
|
17
|
+
};
|
|
18
|
+
/** Storybook-only shell: maps story args to {@link DateSelector} and wires controlled state. */
|
|
19
|
+
declare function DateSelectorStorybook(args: DateSelectorStoryArgs): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
declare const meta: {
|
|
21
|
+
title: string;
|
|
22
|
+
component: typeof DateSelectorStorybook;
|
|
23
|
+
tags: string[];
|
|
24
|
+
parameters: {
|
|
25
|
+
layout: string;
|
|
26
|
+
docs: {
|
|
27
|
+
story: {
|
|
28
|
+
height: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
args: {
|
|
33
|
+
label: string;
|
|
34
|
+
showInput: true;
|
|
35
|
+
showOperators: true;
|
|
36
|
+
showTwoMonths: false;
|
|
37
|
+
allowRange: true;
|
|
38
|
+
showRollingPresets: false;
|
|
39
|
+
defaultPeriodType: "day";
|
|
40
|
+
defaultFilterType: "is";
|
|
41
|
+
presetMode: "unset";
|
|
42
|
+
periodTypesPreset: "all";
|
|
43
|
+
minYear: number;
|
|
44
|
+
maxYear: number;
|
|
45
|
+
yearRange: number;
|
|
46
|
+
weekStartsOn: "unset";
|
|
47
|
+
inputHint: string;
|
|
48
|
+
dayDateFormat: string;
|
|
49
|
+
};
|
|
50
|
+
argTypes: {
|
|
51
|
+
label: {
|
|
52
|
+
control: "text";
|
|
53
|
+
};
|
|
54
|
+
showInput: {
|
|
55
|
+
control: "boolean";
|
|
56
|
+
};
|
|
57
|
+
showOperators: {
|
|
58
|
+
control: "boolean";
|
|
59
|
+
};
|
|
60
|
+
showTwoMonths: {
|
|
61
|
+
control: "boolean";
|
|
62
|
+
};
|
|
63
|
+
allowRange: {
|
|
64
|
+
control: "boolean";
|
|
65
|
+
};
|
|
66
|
+
showRollingPresets: {
|
|
67
|
+
control: "boolean";
|
|
68
|
+
};
|
|
69
|
+
defaultPeriodType: {
|
|
70
|
+
control: "select";
|
|
71
|
+
options: string[];
|
|
72
|
+
};
|
|
73
|
+
defaultFilterType: {
|
|
74
|
+
control: "select";
|
|
75
|
+
options: string[];
|
|
76
|
+
};
|
|
77
|
+
presetMode: {
|
|
78
|
+
control: "select";
|
|
79
|
+
options: string[];
|
|
80
|
+
description: string;
|
|
81
|
+
};
|
|
82
|
+
periodTypesPreset: {
|
|
83
|
+
control: "select";
|
|
84
|
+
options: PeriodTypesPreset[];
|
|
85
|
+
description: string;
|
|
86
|
+
};
|
|
87
|
+
minYear: {
|
|
88
|
+
control: "number";
|
|
89
|
+
};
|
|
90
|
+
maxYear: {
|
|
91
|
+
control: "number";
|
|
92
|
+
};
|
|
93
|
+
yearRange: {
|
|
94
|
+
control: "number";
|
|
95
|
+
};
|
|
96
|
+
baseYear: {
|
|
97
|
+
control: "number";
|
|
98
|
+
};
|
|
99
|
+
weekStartsOn: {
|
|
100
|
+
control: "select";
|
|
101
|
+
options: (string | number)[];
|
|
102
|
+
description: string;
|
|
103
|
+
};
|
|
104
|
+
inputHint: {
|
|
105
|
+
control: "text";
|
|
106
|
+
};
|
|
107
|
+
dayDateFormat: {
|
|
108
|
+
control: "text";
|
|
109
|
+
};
|
|
110
|
+
className: {
|
|
111
|
+
control: false;
|
|
112
|
+
};
|
|
113
|
+
i18n: {
|
|
114
|
+
control: false;
|
|
115
|
+
};
|
|
116
|
+
yearOptions: {
|
|
117
|
+
control: false;
|
|
118
|
+
};
|
|
119
|
+
dayDateFormats: {
|
|
120
|
+
control: false;
|
|
121
|
+
};
|
|
122
|
+
rollingDayOptions: {
|
|
123
|
+
control: false;
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
export default meta;
|
|
128
|
+
type Story = StoryObj<typeof meta>;
|
|
129
|
+
export declare const Default: Story;
|
|
130
|
+
export declare const DayOnly: Story;
|
|
131
|
+
export declare const PresetBetween: Story;
|
|
132
|
+
export declare const NoInput: Story;
|
|
133
|
+
export declare const NoOperators: Story;
|
|
134
|
+
export declare const RollingPresets: Story;
|
|
135
|
+
//# sourceMappingURL=date-selector.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-selector.stories.d.ts","sourceRoot":"","sources":["../../../src/components/date-selector/date-selector.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGvD,OAAO,KAAK,EAAE,sBAAsB,EAA0B,iBAAiB,EAAqB,MAAM,GAAG,CAAC;AAG9G,QAAA,MAAM,mBAAmB;;;;;;;CAOgD,CAAC;AAE1E,KAAK,iBAAiB,GAAG,MAAM,OAAO,mBAAmB,CAAC;AAE1D,4FAA4F;AAC5F,KAAK,qBAAqB,GAAG,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,OAAO,GAAG,UAAU,GAAG,aAAa,GAAG,YAAY,GAAG,cAAc,CAAC,GAAG;IAClI,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,UAAU,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC;IAC9C,YAAY,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAC,CAAC;CAC3E,CAAC;AAYF,gGAAgG;AAChG,iBAAS,qBAAqB,CAAC,IAAI,EAAE,qBAAqB,2CAIzD;AAED,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAoD+C,iBAAiB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoB9B,CAAC;AAE/C,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,OAAO,EAAE,KAerB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAM3B,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAKrB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAMzB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAM5B,CAAC"}
|