@daxence/flexy-date-picker 1.0.0 → 1.0.2
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/features/date-picker/components/calendar/calendar.d.ts +7 -0
- package/dist/features/date-picker/components/calendar/index.d.ts +1 -0
- package/dist/features/date-picker/components/calendar-day/calendar-day.d.ts +7 -0
- package/dist/features/date-picker/components/calendar-day/index.d.ts +1 -0
- package/dist/features/date-picker/components/calendar-header/calendar-header.d.ts +7 -0
- package/dist/features/date-picker/components/calendar-header/index.d.ts +1 -0
- package/dist/features/date-picker/components/calendar-legend/calendar-legend.d.ts +11 -0
- package/dist/features/date-picker/components/calendar-legend/calendar-legend.stories.d.ts +17 -0
- package/dist/features/date-picker/components/calendar-legend/index.d.ts +2 -0
- package/dist/features/date-picker/components/date-input/date-input.d.ts +20 -0
- package/dist/features/date-picker/components/date-input/index.d.ts +1 -0
- package/dist/features/date-picker/components/date-picker/date-picker.d.ts +2 -0
- package/dist/features/date-picker/components/date-picker/date-picker.stories.d.ts +525 -0
- package/dist/features/date-picker/components/date-picker/index.d.ts +1 -0
- package/dist/features/date-picker/components/tooltip/index.d.ts +1 -0
- package/dist/features/date-picker/components/tooltip/tooltip.d.ts +15 -0
- package/dist/features/date-picker/context/date-picker-context.d.ts +30 -0
- package/dist/features/date-picker/context/index.d.ts +2 -0
- package/dist/features/date-picker/index.d.ts +10 -0
- package/dist/features/date-picker/styles/theme-vars.d.ts +3 -0
- package/dist/features/date-picker/types/date-picker.types.d.ts +355 -0
- package/dist/features/date-picker/types/index.d.ts +1 -0
- package/dist/features/date-picker/utils/date-utils.d.ts +37 -0
- package/dist/features/date-picker/utils/index.d.ts +1 -0
- package/dist/features/time-picker/components/time-picker/index.d.ts +2 -0
- package/dist/features/time-picker/components/time-picker/time-picker.d.ts +61 -0
- package/dist/features/time-picker/components/time-picker/time-picker.stories.d.ts +62 -0
- package/dist/features/time-picker/components/time-slot-list/index.d.ts +2 -0
- package/dist/features/time-picker/components/time-slot-list/time-slot-list.d.ts +16 -0
- package/dist/features/time-picker/index.d.ts +4 -0
- package/dist/flexy-date-picker.js +1518 -1541
- package/dist/flexy-date-picker.js.map +1 -1
- package/dist/flexy-date-picker.umd.cjs +2 -2
- package/dist/flexy-date-picker.umd.cjs.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/shared/utils/cx.d.ts +2 -0
- package/dist/styles.d.ts +1 -0
- package/package.json +11 -10
- package/dist/types/index.d.ts +0 -2
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
interface CalendarProps {
|
|
2
|
+
/** For multi-month views, the offset index (0 = first month shown) */
|
|
3
|
+
panelIndex?: number;
|
|
4
|
+
totalPanels?: number;
|
|
5
|
+
}
|
|
6
|
+
export declare function Calendar({ panelIndex, totalPanels }: CalendarProps): import("react").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Calendar } from './calendar';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CalendarDay } from './calendar-day';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
interface CalendarHeaderProps {
|
|
2
|
+
/** When showing multiple months, which panel index this is */
|
|
3
|
+
panelIndex?: number;
|
|
4
|
+
totalPanels?: number;
|
|
5
|
+
}
|
|
6
|
+
export declare function CalendarHeader({ panelIndex, totalPanels }: CalendarHeaderProps): import("react").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CalendarHeader } from './calendar-header';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
export interface LegendItem {
|
|
3
|
+
label: string | ReactNode;
|
|
4
|
+
className: string;
|
|
5
|
+
}
|
|
6
|
+
export interface CalendarLegendProps {
|
|
7
|
+
items?: LegendItem[];
|
|
8
|
+
className?: string;
|
|
9
|
+
style?: CSSProperties;
|
|
10
|
+
}
|
|
11
|
+
export declare function CalendarLegend({ items, className, style, }: CalendarLegendProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
import { CalendarLegend } from './calendar-legend';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof CalendarLegend;
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
};
|
|
9
|
+
tags: string[];
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
type Story = StoryObj<typeof meta>;
|
|
13
|
+
export declare const Default: Story;
|
|
14
|
+
export declare const CustomItems: Story;
|
|
15
|
+
export declare const WithCustomStyling: Story;
|
|
16
|
+
export declare const SingleItem: Story;
|
|
17
|
+
export declare const WithReactNodeLabels: Story;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { DatePickerClassNames, DatePickerStyles, DateValue, DateRange, PickerMode, RenderInputProps } from '../../types';
|
|
2
|
+
interface DateInputProps {
|
|
3
|
+
mode: PickerMode;
|
|
4
|
+
singleValue: DateValue;
|
|
5
|
+
rangeValue: DateRange;
|
|
6
|
+
format: string;
|
|
7
|
+
locale?: string;
|
|
8
|
+
placeholder: string | [string, string];
|
|
9
|
+
isOpen: boolean;
|
|
10
|
+
isDisabled: boolean;
|
|
11
|
+
readOnly: boolean;
|
|
12
|
+
clearable: boolean;
|
|
13
|
+
classNames: DatePickerClassNames;
|
|
14
|
+
styles: DatePickerStyles;
|
|
15
|
+
onOpen: () => void;
|
|
16
|
+
onClear: () => void;
|
|
17
|
+
renderInput?: (props: RenderInputProps) => React.ReactNode;
|
|
18
|
+
}
|
|
19
|
+
export declare function DateInput({ mode, singleValue, rangeValue, format, locale, placeholder, isOpen, isDisabled, readOnly, clearable, classNames, styles: slotStyles, onOpen, onClear, renderInput, }: DateInputProps): import("react").JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DateInput } from './date-input';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { DatePickerProps } from '../../types';
|
|
2
|
+
export declare function DatePicker({ mode, value, defaultValue, rangeValue, defaultRangeValue, format, locale, lang, weekStartsOn, enableTime, timeStep, timeFormat, minTime, maxTime, disabledTime, timeSchedule, defaultTimeSchedule, minDate, maxDate, placeholder, disabled, isDisabled, readOnly, clearable, highlightToday, showAdjacentMonthDays, showOutsideDays, tooltip, tooltipDelay, theme, classNames: classNamesProp, styles: stylesProp, className, style, numberOfMonths, showMonthYearSelectors, inline, placement, renderDay, renderNavButton, renderInput, onDateChange, onRangeChange, onTimeChange, onMonthChange, onYearChange, onDayHover, onOpen, onClose, onClear, onBeforeSelect, onAfterSelect, }: DatePickerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,525 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
import { DatePicker } from './date-picker';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof DatePicker;
|
|
6
|
+
argTypes: {
|
|
7
|
+
mode: {
|
|
8
|
+
control: "select";
|
|
9
|
+
options: string[];
|
|
10
|
+
description: string;
|
|
11
|
+
table: {
|
|
12
|
+
category: string;
|
|
13
|
+
defaultValue: {
|
|
14
|
+
summary: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
value: {
|
|
19
|
+
control: false;
|
|
20
|
+
description: string;
|
|
21
|
+
table: {
|
|
22
|
+
category: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
defaultValue: {
|
|
26
|
+
control: false;
|
|
27
|
+
description: string;
|
|
28
|
+
table: {
|
|
29
|
+
category: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
rangeValue: {
|
|
33
|
+
control: false;
|
|
34
|
+
description: string;
|
|
35
|
+
table: {
|
|
36
|
+
category: string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
defaultRangeValue: {
|
|
40
|
+
control: false;
|
|
41
|
+
description: string;
|
|
42
|
+
table: {
|
|
43
|
+
category: string;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
format: {
|
|
47
|
+
control: "text";
|
|
48
|
+
description: string;
|
|
49
|
+
table: {
|
|
50
|
+
category: string;
|
|
51
|
+
defaultValue: {
|
|
52
|
+
summary: string;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
locale: {
|
|
57
|
+
control: "text";
|
|
58
|
+
description: string;
|
|
59
|
+
table: {
|
|
60
|
+
category: string;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
lang: {
|
|
64
|
+
control: "text";
|
|
65
|
+
description: string;
|
|
66
|
+
table: {
|
|
67
|
+
category: string;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
weekStartsOn: {
|
|
71
|
+
control: "select";
|
|
72
|
+
options: number[];
|
|
73
|
+
description: string;
|
|
74
|
+
table: {
|
|
75
|
+
category: string;
|
|
76
|
+
defaultValue: {
|
|
77
|
+
summary: string;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
numberOfMonths: {
|
|
82
|
+
control: {
|
|
83
|
+
type: "number";
|
|
84
|
+
min: number;
|
|
85
|
+
max: number;
|
|
86
|
+
step: number;
|
|
87
|
+
};
|
|
88
|
+
description: string;
|
|
89
|
+
table: {
|
|
90
|
+
category: string;
|
|
91
|
+
defaultValue: {
|
|
92
|
+
summary: string;
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
showAdjacentMonthDays: {
|
|
97
|
+
control: "boolean";
|
|
98
|
+
description: string;
|
|
99
|
+
table: {
|
|
100
|
+
category: string;
|
|
101
|
+
defaultValue: {
|
|
102
|
+
summary: string;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
highlightToday: {
|
|
107
|
+
control: "boolean";
|
|
108
|
+
description: string;
|
|
109
|
+
table: {
|
|
110
|
+
category: string;
|
|
111
|
+
defaultValue: {
|
|
112
|
+
summary: string;
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
inline: {
|
|
117
|
+
control: "boolean";
|
|
118
|
+
description: string;
|
|
119
|
+
table: {
|
|
120
|
+
category: string;
|
|
121
|
+
defaultValue: {
|
|
122
|
+
summary: string;
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
minDate: {
|
|
127
|
+
control: false;
|
|
128
|
+
description: string;
|
|
129
|
+
table: {
|
|
130
|
+
category: string;
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
maxDate: {
|
|
134
|
+
control: false;
|
|
135
|
+
description: string;
|
|
136
|
+
table: {
|
|
137
|
+
category: string;
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
disabled: {
|
|
141
|
+
control: false;
|
|
142
|
+
description: string;
|
|
143
|
+
table: {
|
|
144
|
+
category: string;
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
isDisabled: {
|
|
148
|
+
control: "boolean";
|
|
149
|
+
description: string;
|
|
150
|
+
table: {
|
|
151
|
+
category: string;
|
|
152
|
+
defaultValue: {
|
|
153
|
+
summary: string;
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
readOnly: {
|
|
158
|
+
control: "boolean";
|
|
159
|
+
description: string;
|
|
160
|
+
table: {
|
|
161
|
+
category: string;
|
|
162
|
+
defaultValue: {
|
|
163
|
+
summary: string;
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
};
|
|
167
|
+
placeholder: {
|
|
168
|
+
control: "text";
|
|
169
|
+
description: string;
|
|
170
|
+
table: {
|
|
171
|
+
category: string;
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
clearable: {
|
|
175
|
+
control: "boolean";
|
|
176
|
+
description: string;
|
|
177
|
+
table: {
|
|
178
|
+
category: string;
|
|
179
|
+
defaultValue: {
|
|
180
|
+
summary: string;
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
enableTime: {
|
|
185
|
+
control: "boolean";
|
|
186
|
+
description: string;
|
|
187
|
+
table: {
|
|
188
|
+
category: string;
|
|
189
|
+
defaultValue: {
|
|
190
|
+
summary: string;
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
timeStep: {
|
|
195
|
+
control: {
|
|
196
|
+
type: "number";
|
|
197
|
+
min: number;
|
|
198
|
+
max: number;
|
|
199
|
+
step: number;
|
|
200
|
+
};
|
|
201
|
+
description: string;
|
|
202
|
+
table: {
|
|
203
|
+
category: string;
|
|
204
|
+
defaultValue: {
|
|
205
|
+
summary: string;
|
|
206
|
+
};
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
timeFormat: {
|
|
210
|
+
control: "text";
|
|
211
|
+
description: string;
|
|
212
|
+
table: {
|
|
213
|
+
category: string;
|
|
214
|
+
defaultValue: {
|
|
215
|
+
summary: string;
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
};
|
|
219
|
+
minTime: {
|
|
220
|
+
control: "text";
|
|
221
|
+
description: string;
|
|
222
|
+
table: {
|
|
223
|
+
category: string;
|
|
224
|
+
defaultValue: {
|
|
225
|
+
summary: string;
|
|
226
|
+
};
|
|
227
|
+
};
|
|
228
|
+
};
|
|
229
|
+
maxTime: {
|
|
230
|
+
control: "text";
|
|
231
|
+
description: string;
|
|
232
|
+
table: {
|
|
233
|
+
category: string;
|
|
234
|
+
defaultValue: {
|
|
235
|
+
summary: string;
|
|
236
|
+
};
|
|
237
|
+
};
|
|
238
|
+
};
|
|
239
|
+
disabledTime: {
|
|
240
|
+
control: false;
|
|
241
|
+
description: string;
|
|
242
|
+
table: {
|
|
243
|
+
category: string;
|
|
244
|
+
};
|
|
245
|
+
};
|
|
246
|
+
tooltip: {
|
|
247
|
+
control: "text";
|
|
248
|
+
description: string;
|
|
249
|
+
table: {
|
|
250
|
+
category: string;
|
|
251
|
+
};
|
|
252
|
+
};
|
|
253
|
+
tooltipDelay: {
|
|
254
|
+
control: {
|
|
255
|
+
type: "number";
|
|
256
|
+
min: number;
|
|
257
|
+
max: number;
|
|
258
|
+
step: number;
|
|
259
|
+
};
|
|
260
|
+
description: string;
|
|
261
|
+
table: {
|
|
262
|
+
category: string;
|
|
263
|
+
defaultValue: {
|
|
264
|
+
summary: string;
|
|
265
|
+
};
|
|
266
|
+
};
|
|
267
|
+
};
|
|
268
|
+
theme: {
|
|
269
|
+
control: "object";
|
|
270
|
+
description: string;
|
|
271
|
+
table: {
|
|
272
|
+
category: string;
|
|
273
|
+
};
|
|
274
|
+
};
|
|
275
|
+
classNames: {
|
|
276
|
+
control: "object";
|
|
277
|
+
description: string;
|
|
278
|
+
table: {
|
|
279
|
+
category: string;
|
|
280
|
+
};
|
|
281
|
+
};
|
|
282
|
+
styles: {
|
|
283
|
+
control: "object";
|
|
284
|
+
description: string;
|
|
285
|
+
table: {
|
|
286
|
+
category: string;
|
|
287
|
+
};
|
|
288
|
+
};
|
|
289
|
+
className: {
|
|
290
|
+
control: "text";
|
|
291
|
+
description: string;
|
|
292
|
+
table: {
|
|
293
|
+
category: string;
|
|
294
|
+
};
|
|
295
|
+
};
|
|
296
|
+
renderDay: {
|
|
297
|
+
control: false;
|
|
298
|
+
description: string;
|
|
299
|
+
table: {
|
|
300
|
+
category: string;
|
|
301
|
+
};
|
|
302
|
+
};
|
|
303
|
+
renderNavButton: {
|
|
304
|
+
control: false;
|
|
305
|
+
description: string;
|
|
306
|
+
table: {
|
|
307
|
+
category: string;
|
|
308
|
+
};
|
|
309
|
+
};
|
|
310
|
+
renderInput: {
|
|
311
|
+
control: false;
|
|
312
|
+
description: string;
|
|
313
|
+
table: {
|
|
314
|
+
category: string;
|
|
315
|
+
};
|
|
316
|
+
};
|
|
317
|
+
onDateChange: {
|
|
318
|
+
action: string;
|
|
319
|
+
description: string;
|
|
320
|
+
table: {
|
|
321
|
+
category: string;
|
|
322
|
+
};
|
|
323
|
+
};
|
|
324
|
+
onRangeChange: {
|
|
325
|
+
action: string;
|
|
326
|
+
description: string;
|
|
327
|
+
table: {
|
|
328
|
+
category: string;
|
|
329
|
+
};
|
|
330
|
+
};
|
|
331
|
+
onTimeChange: {
|
|
332
|
+
action: string;
|
|
333
|
+
description: string;
|
|
334
|
+
table: {
|
|
335
|
+
category: string;
|
|
336
|
+
};
|
|
337
|
+
};
|
|
338
|
+
onMonthChange: {
|
|
339
|
+
action: string;
|
|
340
|
+
description: string;
|
|
341
|
+
table: {
|
|
342
|
+
category: string;
|
|
343
|
+
};
|
|
344
|
+
};
|
|
345
|
+
onYearChange: {
|
|
346
|
+
action: string;
|
|
347
|
+
description: string;
|
|
348
|
+
table: {
|
|
349
|
+
category: string;
|
|
350
|
+
};
|
|
351
|
+
};
|
|
352
|
+
onDayHover: {
|
|
353
|
+
action: string;
|
|
354
|
+
description: string;
|
|
355
|
+
table: {
|
|
356
|
+
category: string;
|
|
357
|
+
};
|
|
358
|
+
};
|
|
359
|
+
onOpen: {
|
|
360
|
+
action: string;
|
|
361
|
+
description: string;
|
|
362
|
+
table: {
|
|
363
|
+
category: string;
|
|
364
|
+
};
|
|
365
|
+
};
|
|
366
|
+
onClose: {
|
|
367
|
+
action: string;
|
|
368
|
+
description: string;
|
|
369
|
+
table: {
|
|
370
|
+
category: string;
|
|
371
|
+
};
|
|
372
|
+
};
|
|
373
|
+
onClear: {
|
|
374
|
+
action: string;
|
|
375
|
+
description: string;
|
|
376
|
+
table: {
|
|
377
|
+
category: string;
|
|
378
|
+
};
|
|
379
|
+
};
|
|
380
|
+
onBeforeSelect: {
|
|
381
|
+
control: false;
|
|
382
|
+
description: string;
|
|
383
|
+
table: {
|
|
384
|
+
category: string;
|
|
385
|
+
};
|
|
386
|
+
};
|
|
387
|
+
onAfterSelect: {
|
|
388
|
+
action: string;
|
|
389
|
+
description: string;
|
|
390
|
+
table: {
|
|
391
|
+
category: string;
|
|
392
|
+
};
|
|
393
|
+
};
|
|
394
|
+
};
|
|
395
|
+
};
|
|
396
|
+
export default meta;
|
|
397
|
+
type Story = StoryObj<typeof meta>;
|
|
398
|
+
/**
|
|
399
|
+
* The out-of-the-box experience with no props set.
|
|
400
|
+
* Click the input to open the calendar and pick a date.
|
|
401
|
+
*/
|
|
402
|
+
export declare const Default: Story;
|
|
403
|
+
/**
|
|
404
|
+
* Full interactive playground — every prop is wired to a Storybook Control.
|
|
405
|
+
* Use the **Controls** panel below to toggle features in real time.
|
|
406
|
+
*/
|
|
407
|
+
export declare const Playground: Story;
|
|
408
|
+
/**
|
|
409
|
+
* Renders the calendar inline — no input trigger or popover.
|
|
410
|
+
* Useful for embedding the picker directly in a form or page.
|
|
411
|
+
*/
|
|
412
|
+
export declare const Inline: Story;
|
|
413
|
+
/**
|
|
414
|
+
* Range selection — click a start date then an end date.
|
|
415
|
+
* The `onRangeChange` action logs each selection step.
|
|
416
|
+
*/
|
|
417
|
+
export declare const RangeSelection: Story;
|
|
418
|
+
/**
|
|
419
|
+
* Dual-panel range picker rendered inline — two months side by side.
|
|
420
|
+
*/
|
|
421
|
+
export declare const RangeInline: Story;
|
|
422
|
+
/**
|
|
423
|
+
* Adds a time-slot panel next to the calendar.
|
|
424
|
+
* The step is 30 minutes and the selectable range is 08:00 – 20:00.
|
|
425
|
+
*/
|
|
426
|
+
export declare const WithTime: Story;
|
|
427
|
+
/**
|
|
428
|
+
* Inline calendar with time selector.
|
|
429
|
+
*/
|
|
430
|
+
export declare const InlineWithTime: Story;
|
|
431
|
+
/**
|
|
432
|
+
* Demonstrates the `disabled` prop with multiple strategies:
|
|
433
|
+
* - Entire weekends via `predicate`
|
|
434
|
+
* - A specific date list
|
|
435
|
+
* - Before / after bounds
|
|
436
|
+
*/
|
|
437
|
+
export declare const DisabledDates: Story;
|
|
438
|
+
/**
|
|
439
|
+
* Constrain selection to a specific window using `minDate` + `maxDate`.
|
|
440
|
+
*/
|
|
441
|
+
export declare const MinMaxDates: Story;
|
|
442
|
+
/**
|
|
443
|
+
* Picker with an initial date selected via `defaultValue`.
|
|
444
|
+
*/
|
|
445
|
+
export declare const PreSelectedDate: Story;
|
|
446
|
+
/**
|
|
447
|
+
* Range picker with a default range via `defaultRangeValue`.
|
|
448
|
+
*/
|
|
449
|
+
export declare const PreSelectedRange: Story;
|
|
450
|
+
/**
|
|
451
|
+
* With `showAdjacentMonthDays: true` the grid is filled with greyed-out
|
|
452
|
+
* days from the previous and next months.
|
|
453
|
+
*/
|
|
454
|
+
export declare const ShowAdjacentMonthDays: Story;
|
|
455
|
+
/**
|
|
456
|
+
* `weekStartsOn: 1` shifts the week grid so Monday is the first column.
|
|
457
|
+
*/
|
|
458
|
+
export declare const WeekStartsMonday: Story;
|
|
459
|
+
/**
|
|
460
|
+
* `numberOfMonths: 3` renders three consecutive calendar panels at once.
|
|
461
|
+
*/
|
|
462
|
+
export declare const MultiMonth: Story;
|
|
463
|
+
/**
|
|
464
|
+
* `isDisabled: true` greys out the input and prevents all interaction.
|
|
465
|
+
*/
|
|
466
|
+
export declare const Disabled: Story;
|
|
467
|
+
/**
|
|
468
|
+
* `readOnly: true` shows the value but prevents changes.
|
|
469
|
+
*/
|
|
470
|
+
export declare const ReadOnly: Story;
|
|
471
|
+
/**
|
|
472
|
+
* `clearable: false` hides the × button — useful when the field is required.
|
|
473
|
+
*/
|
|
474
|
+
export declare const NoClear: Story;
|
|
475
|
+
/**
|
|
476
|
+
* A static string tooltip shown on every day cell.
|
|
477
|
+
*/
|
|
478
|
+
export declare const WithTooltip: Story;
|
|
479
|
+
/**
|
|
480
|
+
* Dynamic tooltip using a render function — shows rich contextual info.
|
|
481
|
+
*/
|
|
482
|
+
export declare const TooltipWithFunction: Story;
|
|
483
|
+
/**
|
|
484
|
+
* Hotel-style range tooltip: labels check-in/check-out and shows a live
|
|
485
|
+
* "X nights" count while hovering the candidate end date or once both
|
|
486
|
+
* dates are selected. Uses the `nights`, `isRangeStart`, `isRangeEnd` and
|
|
487
|
+
* `isPreviewRangeEnd` render props.
|
|
488
|
+
*/
|
|
489
|
+
export declare const TooltipNights: Story;
|
|
490
|
+
/**
|
|
491
|
+
* Override CSS tokens via the `theme` prop to apply a teal accent.
|
|
492
|
+
*/
|
|
493
|
+
export declare const ThemeTeal: Story;
|
|
494
|
+
/**
|
|
495
|
+
* Violet / purple brand accent.
|
|
496
|
+
*/
|
|
497
|
+
export declare const ThemePurple: Story;
|
|
498
|
+
/**
|
|
499
|
+
* Rose / red brand accent with a sharp square border radius.
|
|
500
|
+
*/
|
|
501
|
+
export declare const ThemeRose: Story;
|
|
502
|
+
/**
|
|
503
|
+
* Dark surface + amber accent — simulates a dark mode.
|
|
504
|
+
*/
|
|
505
|
+
export declare const ThemeDark: Story;
|
|
506
|
+
/**
|
|
507
|
+
* `renderDay` lets you inject any content into each day cell.
|
|
508
|
+
* This example adds a red dot indicator for the next 5 days.
|
|
509
|
+
*/
|
|
510
|
+
export declare const CustomDayRenderer: Story;
|
|
511
|
+
/**
|
|
512
|
+
* `renderNavButton` replaces the default ‹ / › buttons with custom elements.
|
|
513
|
+
*/
|
|
514
|
+
export declare const CustomNavButtons: Story;
|
|
515
|
+
/**
|
|
516
|
+
* The `locale` prop switches day/month labels to French.
|
|
517
|
+
*
|
|
518
|
+
* > **Note**: you must import the dayjs locale in your app:
|
|
519
|
+
* > `import 'dayjs/locale/fr'`
|
|
520
|
+
*/
|
|
521
|
+
export declare const LocaleFrench: Story;
|
|
522
|
+
/**
|
|
523
|
+
* `classNames` lets you attach custom CSS classes to individual UI slots.
|
|
524
|
+
*/
|
|
525
|
+
export declare const SlotClassNames: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DatePicker } from './date-picker';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Tooltip } from './tooltip';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React, ReactElement } from 'react';
|
|
2
|
+
import { Placement } from '@floating-ui/react';
|
|
3
|
+
import { TooltipContent, TooltipRenderProps, DatePickerStyles, DatePickerClassNames } from '../../types';
|
|
4
|
+
type AnyProps = Record<string, unknown>;
|
|
5
|
+
interface TooltipProps {
|
|
6
|
+
content: TooltipContent;
|
|
7
|
+
renderProps: TooltipRenderProps;
|
|
8
|
+
delay?: number;
|
|
9
|
+
placement?: Placement;
|
|
10
|
+
classNames?: DatePickerClassNames;
|
|
11
|
+
styles?: DatePickerStyles;
|
|
12
|
+
children: ReactElement<AnyProps>;
|
|
13
|
+
}
|
|
14
|
+
export declare function Tooltip({ content, renderProps, delay, placement, classNames, styles: slotStyles, children, }: TooltipProps): React.JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Dayjs } from 'dayjs';
|
|
2
|
+
import { DateValue, DateRange, PickerMode, DisabledConfig, DatePickerClassNames, DatePickerStyles, TooltipContent, DatePickerEvents } from '../types';
|
|
3
|
+
export interface DatePickerContextValue extends DatePickerEvents {
|
|
4
|
+
mode: PickerMode;
|
|
5
|
+
singleValue: DateValue;
|
|
6
|
+
rangeValue: DateRange;
|
|
7
|
+
hoveredDate: Dayjs | null;
|
|
8
|
+
currentYear: number;
|
|
9
|
+
currentMonth: number;
|
|
10
|
+
setCurrentYear: (y: number) => void;
|
|
11
|
+
setCurrentMonth: (m: number) => void;
|
|
12
|
+
selectDate: (date: Dayjs) => void;
|
|
13
|
+
setHoveredDate: (date: Dayjs | null) => void;
|
|
14
|
+
weekStartsOn: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
15
|
+
locale?: string;
|
|
16
|
+
showMonthYearSelectors?: boolean;
|
|
17
|
+
disabled?: DisabledConfig | boolean;
|
|
18
|
+
isDisabled: boolean;
|
|
19
|
+
readOnly: boolean;
|
|
20
|
+
highlightToday: boolean;
|
|
21
|
+
showAdjacentMonthDays: boolean;
|
|
22
|
+
tooltip?: TooltipContent;
|
|
23
|
+
tooltipDelay: number;
|
|
24
|
+
format: string;
|
|
25
|
+
classNames: DatePickerClassNames;
|
|
26
|
+
styles: DatePickerStyles;
|
|
27
|
+
}
|
|
28
|
+
declare const DatePickerContext: import('react').Context<DatePickerContextValue | null>;
|
|
29
|
+
export declare function useDatePickerContext(): DatePickerContextValue;
|
|
30
|
+
export { DatePickerContext };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { DatePicker } from './components/date-picker';
|
|
2
|
+
export { Calendar } from './components/calendar';
|
|
3
|
+
export { CalendarHeader } from './components/calendar-header';
|
|
4
|
+
export { CalendarDay } from './components/calendar-day';
|
|
5
|
+
export { Tooltip } from './components/tooltip';
|
|
6
|
+
export { CalendarLegend } from './components/calendar-legend';
|
|
7
|
+
export { DatePickerContext, useDatePickerContext } from './context';
|
|
8
|
+
export { isSameDay, isBetween, isRangeStart, isRangeEnd, isInRange, isDateDisabled, generateCalendarDays, getWeekdayLabels, getMonthNames, generateTimeSlots, isTimeDisabled, } from './utils';
|
|
9
|
+
export type { DatePickerProps, DateRange, DateValue, PickerMode, DatePickerClassNames, DatePickerStyles, DatePickerTheme, DatePickerEvents, DisabledConfig, DisabledTimeConfig, TimeRange, DateSchedule, TooltipContent, TooltipRenderProps, DateSelectionMeta, DateSelectionPhase, RenderInputProps, } from './types';
|
|
10
|
+
export type { CalendarLegendProps, LegendItem } from './components/calendar-legend';
|