flowbite-svelte 0.46.23 → 0.47.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/README.md CHANGED
@@ -174,7 +174,7 @@ For full documentation, visit [flowbite-svelte.com](https://flowbite-svelte.com/
174
174
  </a>
175
175
  </td>
176
176
  <td width="33.3333%">
177
- <a href="https://flowbite-svelte.com/docs/experimental/datepicker">
177
+ <a href="https://flowbite-svelte.com/docs/components/datepicker">
178
178
  <img alt="Svelte Datepicker" src="https://flowbite.s3.amazonaws.com/github/svelte/datepicker.jpg">
179
179
  </a>
180
180
  </td>
@@ -1,7 +1,7 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
- import type { HTMLAttributes } from 'svelte/elements';
2
+ import type { HTMLAttributes, HTMLAnchorAttributes } from 'svelte/elements';
3
3
  declare const __propDef: {
4
- props: HTMLAttributes<HTMLAnchorElement | HTMLDivElement> & {
4
+ props: {
5
5
  href?: string;
6
6
  src?: string;
7
7
  rounded?: boolean;
@@ -10,7 +10,7 @@ declare const __propDef: {
10
10
  dot?: object | undefined;
11
11
  alt?: string;
12
12
  size?: "xs" | "sm" | "md" | "lg" | "xl" | "none";
13
- };
13
+ } & (HTMLAnchorAttributes | HTMLAttributes<HTMLDivElement>);
14
14
  events: {
15
15
  [evt: string]: CustomEvent<any>;
16
16
  };
@@ -18,7 +18,8 @@ declare const __propDef: {
18
18
  default: {};
19
19
  };
20
20
  };
21
- export type AvatarProps = typeof __propDef.props;
21
+ type AvatarProps_ = typeof __propDef.props;
22
+ export { AvatarProps_ as AvatarProps };
22
23
  export type AvatarEvents = typeof __propDef.events;
23
24
  export type AvatarSlots = typeof __propDef.slots;
24
25
  /**
@@ -33,6 +34,5 @@ export type AvatarSlots = typeof __propDef.slots;
33
34
  * @prop export let alt: $$Props['alt'] = '';
34
35
  * @prop export let size: NonNullable<$$Props['size']> = 'md';
35
36
  */
36
- export default class Avatar extends SvelteComponentTyped<AvatarProps, AvatarEvents, AvatarSlots> {
37
+ export default class Avatar extends SvelteComponentTyped<AvatarProps_, AvatarEvents, AvatarSlots> {
37
38
  }
38
- export {};
@@ -1,65 +1,292 @@
1
- <script context="module"></script>
2
-
3
- <script>import Calendar from "./Calender.svelte";
1
+ <script>import { createEventDispatcher, onMount } from "svelte";
2
+ import { fade } from "svelte/transition";
3
+ import { Button } from "..";
4
+ export let value = null;
5
+ export let defaultDate = null;
4
6
  export let range = false;
5
- export let datepickerButtons = false;
6
- export let datepickerFormat = "mm/dd/yyyy";
7
- export let datepickerOrientation = "bottom";
8
- export let datepickerTitle = "Flowbite datepicker";
9
- export let attribute = "";
10
- export let inputClass = "bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full ps-10 p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500";
11
- $: setAttribute = (node, params) => {
12
- if (params) {
13
- node.setAttribute(params, "");
7
+ export let rangeFrom = null;
8
+ export let rangeTo = null;
9
+ export let locale = "default";
10
+ export let firstDayOfWeek = 0;
11
+ export let dateFormat = { year: "numeric", month: "long", day: "numeric" };
12
+ export let placeholder = "Select date";
13
+ export let disabled = false;
14
+ export let required = false;
15
+ export let inputClass = "";
16
+ export let color = "primary";
17
+ export let inline = false;
18
+ export let autohide = true;
19
+ export let showActionButtons = false;
20
+ export let title = "";
21
+ const dispatch = createEventDispatcher();
22
+ let isOpen = inline;
23
+ let inputElement;
24
+ let currentMonth = value || defaultDate || /* @__PURE__ */ new Date();
25
+ currentMonth.setDate(1);
26
+ let focusedDate = null;
27
+ let calendarRef;
28
+ $: daysInMonth = getDaysInMonth(currentMonth);
29
+ $: weekdays = getWeekdays();
30
+ onMount(() => {
31
+ if (!inline) {
32
+ document.addEventListener("click", handleClickOutside);
33
+ return () => {
34
+ document.removeEventListener("click", handleClickOutside);
35
+ };
36
+ }
37
+ });
38
+ function getFocusRingClass(color2) {
39
+ switch (color2) {
40
+ case "primary":
41
+ return "focus:ring-2 focus:ring-primary-500 dark:focus:ring-primary-400";
42
+ case "blue":
43
+ return "focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400";
44
+ case "red":
45
+ return "focus:ring-2 focus:ring-red-500 dark:focus:ring-red-400";
46
+ case "green":
47
+ return "focus:ring-2 focus:ring-green-500 dark:focus:ring-green-400";
48
+ case "yellow":
49
+ return "focus:ring-2 focus:ring-yellow-500 dark:focus:ring-yellow-400";
50
+ case "purple":
51
+ return "focus:ring-2 focus:ring-purple-500 dark:focus:ring-purple-400";
52
+ default:
53
+ return "";
54
+ }
55
+ }
56
+ function getRangeBackgroundClass(color2) {
57
+ switch (color2) {
58
+ case "primary":
59
+ return "bg-primary-100 dark:bg-primary-900";
60
+ case "blue":
61
+ return "bg-blue-100 dark:bg-blue-900";
62
+ case "red":
63
+ return "bg-red-100 dark:bg-red-900";
64
+ case "green":
65
+ return "bg-green-100 dark:bg-green-900";
66
+ case "yellow":
67
+ return "bg-yellow-100 dark:bg-yellow-900";
68
+ case "purple":
69
+ return "bg-purple-100 dark:bg-purple-900";
70
+ default:
71
+ return "";
72
+ }
73
+ }
74
+ function getDaysInMonth(date) {
75
+ const year = date.getFullYear();
76
+ const month = date.getMonth();
77
+ const firstDay = new Date(year, month, 0);
78
+ const lastDay = new Date(year, month + 1, 0);
79
+ const daysArray = [];
80
+ let start = firstDay.getDay() - firstDayOfWeek;
81
+ if (start < 0) start += 7;
82
+ for (let i = 0; i < start; i++) {
83
+ daysArray.push(new Date(year, month, -i));
84
+ }
85
+ for (let i = 1; i <= lastDay.getDate(); i++) {
86
+ daysArray.push(new Date(year, month, i));
87
+ }
88
+ const remainingDays = 7 - daysArray.length % 7;
89
+ if (remainingDays < 7) {
90
+ for (let i = 1; i <= remainingDays; i++) {
91
+ daysArray.push(new Date(year, month + 1, i));
92
+ }
93
+ }
94
+ return daysArray;
95
+ }
96
+ function getWeekdays() {
97
+ const weekdays2 = [];
98
+ for (let i = 0; i < 7; i++) {
99
+ const day = new Date(2021, 5, i + firstDayOfWeek);
100
+ weekdays2.push(day.toLocaleString(locale, { weekday: "short" }));
101
+ }
102
+ return weekdays2;
103
+ }
104
+ function changeMonth(increment) {
105
+ currentMonth = new Date(currentMonth.getFullYear(), currentMonth.getMonth() + increment, 1);
106
+ }
107
+ function handleDaySelect(day) {
108
+ if (range) {
109
+ if (!rangeFrom || rangeFrom && rangeTo) {
110
+ rangeFrom = day;
111
+ rangeTo = null;
112
+ } else if (day < rangeFrom) {
113
+ rangeTo = rangeFrom;
114
+ rangeFrom = day;
115
+ } else {
116
+ rangeTo = day;
117
+ }
118
+ dispatch("select", { from: rangeFrom, to: rangeTo });
119
+ } else {
120
+ value = day;
121
+ dispatch("select", value);
122
+ if (autohide && !inline) isOpen = false;
123
+ }
124
+ }
125
+ function handleInputChange() {
126
+ const date = new Date(inputElement.value);
127
+ if (!isNaN(date.getTime())) {
128
+ handleDaySelect(date);
129
+ }
130
+ }
131
+ function handleClickOutside(event) {
132
+ if (isOpen && !inputElement.contains(event.target)) {
133
+ isOpen = false;
14
134
  }
15
- };
135
+ }
136
+ function formatDate(date) {
137
+ if (!date) return "";
138
+ return date.toLocaleDateString(locale, dateFormat);
139
+ }
140
+ function isSelected(day) {
141
+ if (range) {
142
+ return !!(rangeFrom && day.toDateString() === rangeFrom.toDateString()) || !!(rangeTo && day.toDateString() === rangeTo.toDateString());
143
+ }
144
+ return !!(value && day.toDateString() === value.toDateString());
145
+ }
146
+ function isInRange(day) {
147
+ if (!range || !rangeFrom || !rangeTo) return false;
148
+ return day > rangeFrom && day < rangeTo;
149
+ }
150
+ function isToday(day) {
151
+ const today = /* @__PURE__ */ new Date();
152
+ return day.toDateString() === today.toDateString();
153
+ }
154
+ function handleCalendarKeydown(event) {
155
+ if (!isOpen) return;
156
+ if (!focusedDate) {
157
+ focusedDate = value || /* @__PURE__ */ new Date();
158
+ }
159
+ switch (event.key) {
160
+ case "ArrowLeft":
161
+ focusedDate = new Date(focusedDate.getFullYear(), focusedDate.getMonth(), focusedDate.getDate() - 1);
162
+ break;
163
+ case "ArrowRight":
164
+ focusedDate = new Date(focusedDate.getFullYear(), focusedDate.getMonth(), focusedDate.getDate() + 1);
165
+ break;
166
+ case "ArrowUp":
167
+ focusedDate = new Date(focusedDate.getFullYear(), focusedDate.getMonth(), focusedDate.getDate() - 7);
168
+ break;
169
+ case "ArrowDown":
170
+ focusedDate = new Date(focusedDate.getFullYear(), focusedDate.getMonth(), focusedDate.getDate() + 7);
171
+ break;
172
+ case "Enter":
173
+ handleDaySelect(focusedDate);
174
+ break;
175
+ case "Escape":
176
+ isOpen = false;
177
+ inputElement.focus();
178
+ break;
179
+ default:
180
+ return;
181
+ }
182
+ event.preventDefault();
183
+ if (focusedDate.getMonth() !== currentMonth.getMonth()) {
184
+ currentMonth = new Date(focusedDate.getFullYear(), focusedDate.getMonth(), 1);
185
+ }
186
+ setTimeout(() => {
187
+ const focusedButton = calendarRef.querySelector(`button[aria-label="${focusedDate.toLocaleDateString(locale, { weekday: "long", year: "numeric", month: "long", day: "numeric" })}"]`);
188
+ focusedButton?.focus();
189
+ }, 0);
190
+ }
191
+ function handleInputKeydown(event) {
192
+ if (event.key === "Enter" || event.key === " ") {
193
+ event.preventDefault();
194
+ isOpen = !isOpen;
195
+ }
196
+ }
197
+ function handleToday() {
198
+ handleDaySelect(/* @__PURE__ */ new Date());
199
+ }
200
+ function handleClear() {
201
+ value = null;
202
+ rangeFrom = null;
203
+ rangeTo = null;
204
+ dispatch("clear");
205
+ }
206
+ function handleApply() {
207
+ dispatch("apply", range ? { from: rangeFrom, to: rangeTo } : value);
208
+ if (!inline) isOpen = false;
209
+ }
16
210
  </script>
17
211
 
18
- <svelte:head>
19
- <link rel="stylesheet" href="https://unpkg.com/flowbite@1.5.1/dist/flowbite.min.css" />
20
- <script src="https://unpkg.com/flowbite@1.5.1/dist/datepicker.js"></script>
21
- </svelte:head>
22
-
23
- {#if range}
24
- <div date-rangepicker class="flex items-center">
212
+ <div class="relative {inline ? 'inline-block' : ''}">
213
+ {#if !inline}
25
214
  <div class="relative">
26
- <div class="flex absolute inset-y-0 start-0 items-center ps-3 pointer-events-none">
27
- <Calendar />
28
- </div>
29
- <input name="start" type="text" class={inputClass} placeholder="Select date start" />
215
+ <input bind:this={inputElement} type="text" class="w-full px-4 py-2 text-sm border rounded-md focus:outline-none dark:bg-gray-700 dark:text-white dark:border-gray-600 {getFocusRingClass(color)} {inputClass}" {placeholder} value={range ? `${formatDate(rangeFrom)} - ${formatDate(rangeTo)}` : formatDate(value)} on:focus={() => (isOpen = true)} on:input={handleInputChange} on:keydown={handleInputKeydown} {disabled} {required} aria-haspopup="dialog" />
216
+ <button type="button" class="absolute inset-y-0 right-0 flex items-center px-3 text-gray-500 dark:text-gray-400 focus:outline-none" on:click={() => (isOpen = !isOpen)} {disabled} aria-label={isOpen ? 'Close date picker' : 'Open date picker'}>
217
+ <svg class="w-4 h-4 text-gray-500 dark:text-gray-400" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20">
218
+ <path d="M20 4a2 2 0 0 0-2-2h-2V1a1 1 0 0 0-2 0v1h-3V1a1 1 0 0 0-2 0v1H6V1a1 1 0 0 0-2 0v1H2a2 2 0 0 0-2 2v2h20V4ZM0 18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8H0v10Zm5-8h10a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2Z"></path>
219
+ </svg>
220
+ </button>
30
221
  </div>
31
- <span class="mx-4 text-gray-500">to</span>
32
- <div class="relative">
33
- <div class="flex absolute inset-y-0 start-0 items-center ps-3 pointer-events-none">
34
- <Calendar />
222
+ {/if}
223
+
224
+ {#if isOpen || inline}
225
+ <div
226
+ bind:this={calendarRef}
227
+ id="datepicker-dropdown"
228
+ class="
229
+ {inline ? '' : 'absolute z-10 mt-1'}
230
+ bg-white dark:bg-gray-800 rounded-md shadow-lg"
231
+ transition:fade={{ duration: 100 }}
232
+ role="dialog"
233
+ aria-label="Calendar">
234
+ <div class="p-4" role="application">
235
+ {#if title}
236
+ <h2 class="text-lg font-semibold mb-4 dark:text-white">{title}</h2>
237
+ {/if}
238
+ <div class="flex items-center justify-between mb-4">
239
+ <Button on:click={() => changeMonth(-1)} {color} size="sm" aria-label="Previous month">
240
+ <svg class="w-3 h-3 rtl:rotate-180 text-white dark:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 10"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 5H1m0 0 4 4M1 5l4-4"></path></svg>
241
+ </Button>
242
+ <h3 class="text-lg font-semibold dark:text-white" aria-live="polite">
243
+ {currentMonth.toLocaleString(locale, { month: 'long', year: 'numeric' })}
244
+ </h3>
245
+ <Button on:click={() => changeMonth(1)} {color} size="sm" aria-label="Next month">
246
+ <svg class="w-3 h-3 rtl:rotate-180 text-white dark:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 10"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M1 5h12m0 0L9 1m4 4L9 9"></path></svg>
247
+ </Button>
248
+ </div>
249
+ <div class="grid grid-cols-7 gap-1" role="grid">
250
+ {#each weekdays as day}
251
+ <div class="text-center text-sm font-medium text-gray-500 dark:text-gray-400" role="columnheader">{day}</div>
252
+ {/each}
253
+ {#each daysInMonth as day}
254
+ <Button color={isSelected(day) ? color : 'alternative'} size="sm" class="w-full h-8 {day.getMonth() !== currentMonth.getMonth() ? 'text-gray-300 dark:text-gray-600' : ''} {isToday(day) ? 'font-bold' : ''} {isInRange(day) ? getRangeBackgroundClass(color) : ''}" on:click={() => handleDaySelect(day)} on:keydown={handleCalendarKeydown} aria-label={day.toLocaleDateString(locale, { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' })} aria-selected={isSelected(day)} role="gridcell">
255
+ {day.getDate()}
256
+ </Button>
257
+ {/each}
258
+ </div>
259
+ {#if showActionButtons}
260
+ <div class="mt-4 flex justify-between">
261
+ <Button on:click={handleToday} {color} size="sm">Today</Button>
262
+ <Button on:click={handleClear} color="red" size="sm">Clear</Button>
263
+ <Button on:click={handleApply} {color} size="sm">Apply</Button>
264
+ </div>
265
+ {/if}
35
266
  </div>
36
- <input name="end" type="text" class={inputClass} placeholder="Select date end" />
37
- </div>
38
- </div>
39
- {:else}
40
- <div class="relative">
41
- <div class="flex absolute inset-y-0 start-0 items-center ps-3 pointer-events-none">
42
- <Calendar />
43
267
  </div>
44
- {#if datepickerButtons}
45
- <input {...$$restProps} datepicker datepicker-buttons datepicker-format={datepickerFormat} datepicker-orientation={datepickerOrientation} datepicker-title={datepickerTitle} use:setAttribute={attribute} type="text" class={inputClass} placeholder="Select date" />
46
- {:else}
47
- <input {...$$restProps} datepicker datepicker-format={datepickerFormat} datepicker-orientation={datepickerOrientation} datepicker-title={datepickerTitle} use:setAttribute={attribute} type="text" class={inputClass} placeholder="Select date" />
48
- {/if}
49
- <slot />
50
- </div>
51
- {/if}
268
+ {/if}
269
+ </div>
52
270
 
53
271
  <!--
54
272
  @component
55
273
  [Go to docs](https://flowbite-svelte.com/)
56
274
  ## Props
275
+ @prop export let value: Date | null = null;
276
+ @prop export let defaultDate: Date | null = null;
57
277
  @prop export let range: boolean = false;
58
- @prop export let autoHide: boolean = false;
59
- @prop export let datepickerButtons: boolean = false;
60
- @prop export let datepickerFormat: string = 'mm/dd/yyyy';
61
- @prop export let datepickerOrientation: string = 'bottom';
62
- @prop export let datepickerTitle: string = 'Flowbite datepicker';
63
- @prop export let attribute: string = '';
64
- @prop export let inputClass: string = 'bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full ps-10 p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500';
278
+ @prop export let rangeFrom: Date | null = null;
279
+ @prop export let rangeTo: Date | null = null;
280
+ @prop export let locale: string = 'default';
281
+ @prop export let firstDayOfWeek: number = 0;
282
+ @prop export let dateFormat: Intl.DateTimeFormatOptions = { year: 'numeric', month: 'long', day: 'numeric' };
283
+ @prop export let placeholder: string = 'Select date';
284
+ @prop export let disabled: boolean = false;
285
+ @prop export let required: boolean = false;
286
+ @prop export let inputClass: string = '';
287
+ @prop export let color: Button['color'] = 'primary';
288
+ @prop export let inline: boolean = false;
289
+ @prop export let autohide: boolean = true;
290
+ @prop export let showActionButtons: boolean = false;
291
+ @prop export let title: string = '';
65
292
  -->
@@ -1,32 +1,33 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
- declare module 'svelte/elements' {
3
- interface HTMLAttributes<T> {
4
- [x: `data-${string}`]: any;
5
- 'date-rangepicker'?: boolean;
6
- datepicker?: boolean;
7
- 'datepicker-buttons'?: boolean;
8
- 'datepicker-format'?: string;
9
- 'datepicker-orientation'?: string;
10
- 'datepicker-title'?: string;
11
- }
12
- }
2
+ import { Button } from '..';
13
3
  declare const __propDef: {
14
4
  props: {
15
- [x: string]: any;
16
- range?: boolean | undefined;
17
- datepickerButtons?: boolean | undefined;
18
- datepickerFormat?: string | undefined;
19
- datepickerOrientation?: string | undefined;
20
- datepickerTitle?: string | undefined;
21
- attribute?: string | undefined;
22
- inputClass?: string | undefined;
5
+ value?: Date | null;
6
+ defaultDate?: Date | null;
7
+ range?: boolean;
8
+ rangeFrom?: Date | null;
9
+ rangeTo?: Date | null;
10
+ locale?: string;
11
+ firstDayOfWeek?: number;
12
+ dateFormat?: Intl.DateTimeFormatOptions;
13
+ placeholder?: string;
14
+ disabled?: boolean;
15
+ required?: boolean;
16
+ inputClass?: string;
17
+ color?: Button["color"];
18
+ inline?: boolean;
19
+ autohide?: boolean;
20
+ showActionButtons?: boolean;
21
+ title?: string;
23
22
  };
24
23
  events: {
24
+ select: CustomEvent<any>;
25
+ clear: CustomEvent<any>;
26
+ apply: CustomEvent<any>;
27
+ } & {
25
28
  [evt: string]: CustomEvent<any>;
26
29
  };
27
- slots: {
28
- default: {};
29
- };
30
+ slots: {};
30
31
  };
31
32
  export type DatepickerProps = typeof __propDef.props;
32
33
  export type DatepickerEvents = typeof __propDef.events;
@@ -34,14 +35,23 @@ export type DatepickerSlots = typeof __propDef.slots;
34
35
  /**
35
36
  * [Go to docs](https://flowbite-svelte.com/)
36
37
  * ## Props
38
+ * @prop export let value: Date | null = null;
39
+ * @prop export let defaultDate: Date | null = null;
37
40
  * @prop export let range: boolean = false;
38
- * @prop export let autoHide: boolean = false;
39
- * @prop export let datepickerButtons: boolean = false;
40
- * @prop export let datepickerFormat: string = 'mm/dd/yyyy';
41
- * @prop export let datepickerOrientation: string = 'bottom';
42
- * @prop export let datepickerTitle: string = 'Flowbite datepicker';
43
- * @prop export let attribute: string = '';
44
- * @prop export let inputClass: string = 'bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full ps-10 p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500';
41
+ * @prop export let rangeFrom: Date | null = null;
42
+ * @prop export let rangeTo: Date | null = null;
43
+ * @prop export let locale: string = 'default';
44
+ * @prop export let firstDayOfWeek: number = 0;
45
+ * @prop export let dateFormat: Intl.DateTimeFormatOptions = { year: 'numeric', month: 'long', day: 'numeric' };
46
+ * @prop export let placeholder: string = 'Select date';
47
+ * @prop export let disabled: boolean = false;
48
+ * @prop export let required: boolean = false;
49
+ * @prop export let inputClass: string = '';
50
+ * @prop export let color: Button['color'] = 'primary';
51
+ * @prop export let inline: boolean = false;
52
+ * @prop export let autohide: boolean = true;
53
+ * @prop export let showActionButtons: boolean = false;
54
+ * @prop export let title: string = '';
45
55
  */
46
56
  export default class Datepicker extends SvelteComponentTyped<DatepickerProps, DatepickerEvents, DatepickerSlots> {
47
57
  }
@@ -1,5 +1,5 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
- import type { drawerTransitionParamTypes, drawerTransitionTypes } from '../types';
2
+ import type { drawerTransitionParamTypes, TransitionTypes } from '../types';
3
3
  import type { HTMLAttributes } from 'svelte/elements';
4
4
  declare const __propDef: {
5
5
  props: HTMLAttributes<HTMLElement> & {
@@ -18,7 +18,7 @@ declare const __propDef: {
18
18
  id?: string;
19
19
  divClass?: string;
20
20
  transitionParams?: drawerTransitionParamTypes;
21
- transitionType?: drawerTransitionTypes;
21
+ transitionType?: TransitionTypes;
22
22
  };
23
23
  events: {
24
24
  [evt: string]: CustomEvent<any>;
@@ -1,11 +1,11 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
- import type { HTMLAttributes } from 'svelte/elements';
2
+ import type { HTMLButtonAttributes, HTMLAnchorAttributes } from 'svelte/elements';
3
3
  declare const __propDef: {
4
- props: HTMLAttributes<HTMLAnchorElement | HTMLButtonElement> & {
4
+ props: {
5
5
  defaultClass?: string;
6
6
  href?: string;
7
7
  activeClass?: string;
8
- };
8
+ } & (HTMLAnchorAttributes | HTMLButtonAttributes);
9
9
  events: {
10
10
  click: MouseEvent;
11
11
  change: Event;
@@ -22,7 +22,8 @@ declare const __propDef: {
22
22
  default: {};
23
23
  };
24
24
  };
25
- export type DropdownItemProps = typeof __propDef.props;
25
+ type DropdownItemProps_ = typeof __propDef.props;
26
+ export { DropdownItemProps_ as DropdownItemProps };
26
27
  export type DropdownItemEvents = typeof __propDef.events;
27
28
  export type DropdownItemSlots = typeof __propDef.slots;
28
29
  /**
@@ -33,6 +34,5 @@ export type DropdownItemSlots = typeof __propDef.slots;
33
34
  * @prop export let activeClass: $$Props['activeClass'] = undefined;
34
35
  * @prop export let active: boolean = false;
35
36
  */
36
- export default class DropdownItem extends SvelteComponentTyped<DropdownItemProps, DropdownItemEvents, DropdownItemSlots> {
37
+ export default class DropdownItem extends SvelteComponentTyped<DropdownItemProps_, DropdownItemEvents, DropdownItemSlots> {
37
38
  }
38
- export {};
@@ -1,19 +1,17 @@
1
1
  <script>import { twMerge } from "tailwind-merge";
2
2
  import Input from "./Input.svelte";
3
- export let value = "";
4
3
  export let files = void 0;
5
4
  export let inputClass = "border !p-0 dark:text-gray-400";
6
5
  </script>
7
6
 
8
7
  <Input {...$$restProps} class={twMerge(inputClass, $$props.class)} let:props>
9
- <input type="file" on:change on:keyup on:keydown on:keypress on:focus on:blur on:click on:mouseover on:mouseenter on:mouseleave on:paste bind:value bind:files {...props} />
8
+ <input type="file" on:change on:keyup on:keydown on:keypress on:focus on:blur on:click on:mouseover on:mouseenter on:mouseleave on:paste bind:files {...props} />
10
9
  </Input>
11
10
 
12
11
  <!--
13
12
  @component
14
13
  [Go to docs](https://flowbite-svelte.com/)
15
14
  ## Props
16
- @prop export let value: $$Props['value'] = '';
17
15
  @prop export let files: $$Props['files'] = undefined;
18
16
  @prop export let inputClass: $$Props['inputClass'] = 'border !p-0 dark:text-gray-400';
19
17
  -->
@@ -9,7 +9,6 @@ declare const __propDef: {
9
9
  color?: "base" | "green" | "red";
10
10
  floatClass?: string;
11
11
  } & {
12
- value?: string;
13
12
  files?: FileList | undefined;
14
13
  inputClass?: string;
15
14
  };
@@ -36,7 +35,6 @@ export type FileuploadSlots = typeof __propDef.slots;
36
35
  /**
37
36
  * [Go to docs](https://flowbite-svelte.com/)
38
37
  * ## Props
39
- * @prop export let value: $$Props['value'] = '';
40
38
  * @prop export let files: $$Props['files'] = undefined;
41
39
  * @prop export let inputClass: $$Props['inputClass'] = 'border !p-0 dark:text-gray-400';
42
40
  */
@@ -1,11 +1,11 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
- import type { HTMLAttributes } from 'svelte/elements';
2
+ import type { HTMLAttributes, HTMLAnchorAttributes } from 'svelte/elements';
3
3
  declare const __propDef: {
4
- props: HTMLAttributes<HTMLAnchorElement | HTMLDivElement> & {
4
+ props: {
5
5
  href?: string;
6
6
  activeClass?: string;
7
7
  nonActiveClass?: string;
8
- };
8
+ } & (HTMLAnchorAttributes | HTMLAttributes<HTMLDivElement>);
9
9
  events: {
10
10
  blur: FocusEvent;
11
11
  change: Event;
@@ -24,7 +24,8 @@ declare const __propDef: {
24
24
  default: {};
25
25
  };
26
26
  };
27
- export type NavLiProps = typeof __propDef.props;
27
+ type NavLiProps_ = typeof __propDef.props;
28
+ export { NavLiProps_ as NavLiProps };
28
29
  export type NavLiEvents = typeof __propDef.events;
29
30
  export type NavLiSlots = typeof __propDef.slots;
30
31
  /**
@@ -34,6 +35,5 @@ export type NavLiSlots = typeof __propDef.slots;
34
35
  * @prop export let activeClass: $$Props['activeClass'] = undefined;
35
36
  * @prop export let nonActiveClass: $$Props['nonActiveClass'] = undefined;
36
37
  */
37
- export default class NavLi extends SvelteComponentTyped<NavLiProps, NavLiEvents, NavLiSlots> {
38
+ export default class NavLi extends SvelteComponentTyped<NavLiProps_, NavLiEvents, NavLiSlots> {
38
39
  }
39
- export {};
@@ -1,13 +1,13 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
- import type { HTMLAttributes } from 'svelte/elements';
2
+ import type { HTMLButtonAttributes, HTMLAnchorAttributes } from 'svelte/elements';
3
3
  declare const __propDef: {
4
- props: HTMLAttributes<HTMLAnchorElement | HTMLButtonElement> & {
4
+ props: {
5
5
  href?: string;
6
6
  active?: boolean;
7
7
  activeClass?: string;
8
8
  normalClass?: string;
9
9
  large?: boolean;
10
- };
10
+ } & (HTMLAnchorAttributes | HTMLButtonAttributes);
11
11
  events: {
12
12
  blur: FocusEvent;
13
13
  change: Event;
@@ -26,7 +26,8 @@ declare const __propDef: {
26
26
  default: {};
27
27
  };
28
28
  };
29
- export type PaginationItemProps = typeof __propDef.props;
29
+ type PaginationItemProps_ = typeof __propDef.props;
30
+ export { PaginationItemProps_ as PaginationItemProps };
30
31
  export type PaginationItemEvents = typeof __propDef.events;
31
32
  export type PaginationItemSlots = typeof __propDef.slots;
32
33
  /**
@@ -38,6 +39,5 @@ export type PaginationItemSlots = typeof __propDef.slots;
38
39
  * @prop export let normalClass: $$Props['normalClass'] = 'text-gray-500 bg-white hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white';
39
40
  * @prop export let large: $$Props['large'] = false;
40
41
  */
41
- export default class PaginationItem extends SvelteComponentTyped<PaginationItemProps, PaginationItemEvents, PaginationItemSlots> {
42
+ export default class PaginationItem extends SvelteComponentTyped<PaginationItemProps_, PaginationItemEvents, PaginationItemSlots> {
42
43
  }
43
- export {};
package/dist/types.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import type { HTMLAnchorAttributes, HTMLButtonAttributes } from 'svelte/elements';
2
2
  export type BlockQuoteType = 'xs' | 'sm' | 'base' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' | '7xl' | '8xl' | '9xl';
3
- export type ButtonType = 'button' | 'submit' | 'reset';
4
3
  export type ButtonColorType = 'alternative' | 'blue' | 'dark' | 'green' | 'light' | 'primary' | 'purple' | 'red' | 'yellow' | 'none';
5
4
  export type CheckboxItem = {
6
5
  value: string;
@@ -8,7 +7,6 @@ export type CheckboxItem = {
8
7
  isChecked?: boolean;
9
8
  };
10
9
  export type ColorVariant = 'dark' | 'red' | 'yellow' | 'green' | 'indigo' | 'purple' | 'pink' | 'blue' | 'primary' | 'none';
11
- export type Colors = 'blue' | 'gray' | 'red' | 'yellow' | 'purple' | 'green' | 'indigo' | 'pink' | 'white' | 'custom' | 'primary' | 'secondary';
12
10
  export type ImgType = {
13
11
  src: string;
14
12
  alt?: string;
@@ -16,14 +14,11 @@ export type ImgType = {
16
14
  export type IndicatorColorType = 'gray' | 'dark' | 'blue' | 'green' | 'red' | 'purple' | 'indigo' | 'yellow' | 'teal' | 'none';
17
15
  export type IndicatorPlacementType = 'top-left' | 'top-center' | 'top-right' | 'center-left' | 'center' | 'center-right' | 'bottom-left' | 'bottom-center' | 'bottom-right' | undefined;
18
16
  export type InputType = 'color' | 'date' | 'datetime-local' | 'email' | 'file' | 'hidden' | 'image' | 'month' | 'number' | 'password' | 'reset' | 'submit' | 'tel' | 'text' | 'time' | 'url' | 'week' | 'search';
19
- export type drawerTransitionTypes = 'fade' | 'fly' | 'slide' | 'blur' | 'in:fly' | 'out:fly' | 'in:slide' | 'out:slide' | 'in:fade' | 'out:fade' | 'in:blur' | 'out:blur' | undefined;
20
17
  export type FormColorType = 'blue' | 'red' | 'green' | 'purple' | 'teal' | 'yellow' | 'orange' | 'primary' | 'secondary';
21
18
  export type ModalPlacementType = 'top-left' | 'top-center' | 'top-right' | 'center-left' | 'center' | 'center-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
22
19
  export type PsizeType = 'xs' | 'sm' | 'base' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' | '7xl' | '8xl' | '9xl';
23
20
  export type PweightType = 'thin' | 'extralight' | 'light' | 'normal' | 'medium' | 'semibold' | 'bold' | 'extrabold' | 'black';
24
21
  export type TableColorType = 'blue' | 'green' | 'red' | 'yellow' | 'purple' | 'indigo' | 'pink' | 'default' | 'custom';
25
- export type ToolbarColorType = 'gray' | 'red' | 'yellow' | 'green' | 'indigo' | 'purple' | 'pink' | 'blue' | 'dark' | 'none';
26
- export type ToolbarButtonType = 'dark' | 'default' | 'gray' | 'red' | 'yellow' | 'green' | 'indigo' | 'purple' | 'pink' | 'blue';
27
22
  export declare const xs = "xs";
28
23
  export declare const sm = "sm";
29
24
  export declare const md = "md";
@@ -90,12 +85,6 @@ export interface LinkType {
90
85
  rel?: string;
91
86
  active?: boolean;
92
87
  }
93
- export interface NavbarType {
94
- name: string;
95
- href: string;
96
- rel?: string;
97
- child?: NavbarType[];
98
- }
99
88
  export interface SiteType {
100
89
  name: string;
101
90
  href: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flowbite-svelte",
3
- "version": "0.46.23",
3
+ "version": "0.47.1",
4
4
  "description": "Flowbite components for Svelte",
5
5
  "main": "dist/index.js",
6
6
  "author": {
@@ -12,23 +12,24 @@
12
12
  "homepage": "https://flowbite-svelte.com/",
13
13
  "license": "MIT",
14
14
  "devDependencies": {
15
- "@changesets/cli": "^2.27.9",
15
+ "@changesets/cli": "2.27.9",
16
16
  "@docsearch/css": "^3.6.2",
17
17
  "@docsearch/js": "^3.6.2",
18
- "@playwright/test": "^1.48.0",
18
+ "@playwright/test": "^1.48.1",
19
19
  "@sveltejs/adapter-vercel": "^5.4.5",
20
- "@sveltejs/kit": "^2.6.3",
20
+ "@sveltejs/kit": "^2.7.1",
21
21
  "@sveltejs/package": "2.3.2",
22
22
  "@sveltejs/vite-plugin-svelte": "^3.1.2",
23
- "@svitejs/changesets-changelog-github-compact": "^1.1.0",
23
+ "@svitejs/changesets-changelog-github-compact": "^1.2.0",
24
24
  "@types/eslint": "^8.56.12",
25
25
  "autoprefixer": "^10.4.20",
26
26
  "dayjs": "^1.11.13",
27
27
  "esbuild": "0.23.1",
28
28
  "eslint": "^9.12.0",
29
29
  "eslint-config-prettier": "^9.1.0",
30
- "eslint-plugin-svelte": "^2.44.1",
31
- "flowbite-svelte-icons": "^1.6.1",
30
+ "eslint-plugin-svelte": "^2.45.1",
31
+ "flowbite-svelte-icons": "^1.6.2",
32
+ "globals": "^15.11.0",
32
33
  "mdsvex": "^0.12.3",
33
34
  "mdsvexamples": "^0.4.1",
34
35
  "postcss": "^8.4.47",
@@ -37,17 +38,17 @@
37
38
  "prism-themes": "^1.9.0",
38
39
  "publint": "^0.2.11",
39
40
  "svelte": "^4.2.19",
40
- "svelte-check": "^4.0.4",
41
+ "svelte-check": "^4.0.5",
41
42
  "svelte-lib-helpers": "^0.4.16",
42
43
  "svelte-meta-tags": "^3.1.4",
43
44
  "svelte-preprocess": "^6.0.3",
44
- "svelte2tsx": "^0.7.21",
45
+ "svelte2tsx": "^0.7.22",
45
46
  "tailwind-merge": "^1.13.1",
46
- "tailwindcss": "^3.4.13",
47
- "tslib": "^2.7.0",
47
+ "tailwindcss": "^3.4.14",
48
+ "tslib": "^2.8.0",
48
49
  "typescript": "^5.6.3",
49
50
  "typescript-eslint": "8.4.0",
50
- "vite": "^5.4.8",
51
+ "vite": "^5.4.9",
51
52
  "vitest": "^1.6.0"
52
53
  },
53
54
  "peerDependencies": {
@@ -98,9 +99,9 @@
98
99
  },
99
100
  "dependencies": {
100
101
  "@floating-ui/dom": "^1.6.11",
101
- "apexcharts": "^3.54.0",
102
+ "apexcharts": "^3.54.1",
102
103
  "flowbite": "^2.5.2",
103
- "tailwind-merge": "^2.5.3"
104
+ "tailwind-merge": "^2.5.4"
104
105
  },
105
106
  "engines": {
106
107
  "pnpm": ">=8.0.0",
@@ -218,14 +219,6 @@
218
219
  "types": "./dist/darkmode/DarkMode.svelte.d.ts",
219
220
  "svelte": "./dist/darkmode/DarkMode.svelte"
220
221
  },
221
- "./Calender.svelte": {
222
- "types": "./dist/datepicker/Calender.svelte.d.ts",
223
- "svelte": "./dist/datepicker/Calender.svelte"
224
- },
225
- "./DateCalender.svelte": {
226
- "types": "./dist/datepicker/DateCalender.svelte.d.ts",
227
- "svelte": "./dist/datepicker/DateCalender.svelte"
228
- },
229
222
  "./Datepicker.svelte": {
230
223
  "types": "./dist/datepicker/Datepicker.svelte.d.ts",
231
224
  "svelte": "./dist/datepicker/Datepicker.svelte"
@@ -1,3 +0,0 @@
1
- <svg aria-hidden="true" class="w-5 h-5 text-gray-500 dark:text-gray-400" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
2
- <path fill-rule="evenodd" d="M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z" clip-rule="evenodd" />
3
- </svg>
@@ -1,23 +0,0 @@
1
- /** @typedef {typeof __propDef.props} CalenderProps */
2
- /** @typedef {typeof __propDef.events} CalenderEvents */
3
- /** @typedef {typeof __propDef.slots} CalenderSlots */
4
- export default class Calender extends SvelteComponentTyped<{
5
- [x: string]: never;
6
- }, {
7
- [evt: string]: CustomEvent<any>;
8
- }, {}> {
9
- }
10
- export type CalenderProps = typeof __propDef.props;
11
- export type CalenderEvents = typeof __propDef.events;
12
- export type CalenderSlots = typeof __propDef.slots;
13
- import { SvelteComponentTyped } from "svelte";
14
- declare const __propDef: {
15
- props: {
16
- [x: string]: never;
17
- };
18
- events: {
19
- [evt: string]: CustomEvent<any>;
20
- };
21
- slots: {};
22
- };
23
- export {};
@@ -1,150 +0,0 @@
1
- <script>import { createEventDispatcher } from "svelte";
2
- import { Button, Modal } from "..";
3
- import { ChevronLeftOutline, ChevronRightOutline } from "flowbite-svelte-icons";
4
- export let currentDate = /* @__PURE__ */ new Date();
5
- export let open = false;
6
- export let locale = "default";
7
- export let firstDayOfWeek = 0;
8
- export let showToday = true;
9
- export let showClose = true;
10
- export let dateFormat = { month: "long", year: "numeric" };
11
- export let dayLabelFormat = "short";
12
- export let customClass = "";
13
- export let primaryColor = "blue";
14
- export let secondaryColor = "gray";
15
- const dispatch = createEventDispatcher();
16
- let currentMonth = new Date(currentDate.getFullYear(), currentDate.getMonth(), 1);
17
- let daysInMonth = getDaysInMonth(currentMonth);
18
- function getDaysInMonth(date) {
19
- const year = date.getFullYear();
20
- const month = date.getMonth();
21
- const firstDay = new Date(year, month, 1);
22
- const lastDay = new Date(year, month + 1, 0);
23
- const daysArray = [];
24
- let start = firstDay.getDay() - firstDayOfWeek;
25
- if (start < 0) start += 7;
26
- for (let i = 0; i < start; i++) {
27
- const prevMonthDay = new Date(year, month, -i);
28
- daysArray.unshift(prevMonthDay);
29
- }
30
- for (let i = 1; i <= lastDay.getDate(); i++) {
31
- daysArray.push(new Date(year, month, i));
32
- }
33
- const remainingDays = 7 - daysArray.length % 7;
34
- if (remainingDays < 7) {
35
- for (let i = 1; i <= remainingDays; i++) {
36
- daysArray.push(new Date(year, month + 1, i));
37
- }
38
- }
39
- return daysArray;
40
- }
41
- function changeMonth(increment) {
42
- currentMonth = new Date(currentMonth.getFullYear(), currentMonth.getMonth() + increment, 1);
43
- daysInMonth = getDaysInMonth(currentMonth);
44
- }
45
- function handleDaySelect(day) {
46
- dispatch("selectDay", day);
47
- open = false;
48
- }
49
- function isCurrentMonth(day) {
50
- return day.getMonth() === currentMonth.getMonth();
51
- }
52
- function handleClose() {
53
- open = false;
54
- dispatch("close");
55
- }
56
- function goToToday() {
57
- const today = /* @__PURE__ */ new Date();
58
- currentMonth = new Date(today.getFullYear(), today.getMonth(), 1);
59
- daysInMonth = getDaysInMonth(currentMonth);
60
- currentDate = today;
61
- handleDaySelect(today);
62
- }
63
- function isToday(day) {
64
- const today = /* @__PURE__ */ new Date();
65
- return day.getDate() === today.getDate() && day.getMonth() === today.getMonth() && day.getFullYear() === today.getFullYear();
66
- }
67
- $: weekdays = [...Array(7)].map((_, i) => {
68
- const day = new Date(2021, 5, i + firstDayOfWeek);
69
- return day.toLocaleString(locale, { weekday: dayLabelFormat });
70
- });
71
- export function setDate(date) {
72
- currentDate = date;
73
- currentMonth = new Date(date.getFullYear(), date.getMonth(), 1);
74
- daysInMonth = getDaysInMonth(currentMonth);
75
- }
76
- export function nextMonth() {
77
- changeMonth(1);
78
- }
79
- export function previousMonth() {
80
- changeMonth(-1);
81
- }
82
- export function setMonth(month) {
83
- currentMonth = new Date(currentMonth.getFullYear(), month, 1);
84
- daysInMonth = getDaysInMonth(currentMonth);
85
- }
86
- export function setYear(year) {
87
- currentMonth = new Date(year, currentMonth.getMonth(), 1);
88
- daysInMonth = getDaysInMonth(currentMonth);
89
- }
90
- </script>
91
-
92
- <Modal bind:open size="xs" autoclose={false} class={`w-full ${customClass}`}>
93
- <div class="w-full max-w-md rounded-lg p-6">
94
- <div class="mb-4 flex items-center justify-between">
95
- <Button size="sm" on:click={() => changeMonth(-1)} color={primaryColor}>
96
- <ChevronLeftOutline size="md" />
97
- </Button>
98
- <span class="text-lg font-semibold">
99
- {currentMonth.toLocaleString(locale, dateFormat)}
100
- </span>
101
- <Button size="sm" on:click={() => changeMonth(1)} color={primaryColor}>
102
- <ChevronRightOutline size="md" />
103
- </Button>
104
- </div>
105
- <div class="grid grid-cols-7 gap-2">
106
- {#each weekdays as day}
107
- <div class="text-center text-sm font-medium">{day}</div>
108
- {/each}
109
- {#each daysInMonth as day}
110
- <Button
111
- size="sm"
112
- color={currentDate.toDateString() === day.toDateString()
113
- ? primaryColor
114
- : isToday(day)
115
- ? secondaryColor
116
- : 'alternative'}
117
- class={!isCurrentMonth(day) ? 'opacity-50' : ''}
118
- on:click={() => handleDaySelect(day)}
119
- >
120
- {day.getDate()}
121
- </Button>
122
- {/each}
123
- </div>
124
- <div class="mt-4 flex justify-between">
125
- {#if showToday}
126
- <Button size="sm" color={primaryColor} on:click={goToToday}>Today</Button>
127
- {/if}
128
- {#if showClose}
129
- <Button size="sm" color={primaryColor} on:click={handleClose}>Close</Button>
130
- {/if}
131
- </div>
132
- </div>
133
- </Modal>
134
-
135
- <!--
136
- @component
137
- [Go to docs](https://flowbite-svelte.com/)
138
- ## Props
139
- @prop export let currentDate: Date = new Date();
140
- @prop export let open = false;
141
- @prop export let locale: string = 'default';
142
- @prop export let firstDayOfWeek: number = 0;
143
- @prop export let showToday: boolean = true;
144
- @prop export let showClose: boolean = true;
145
- @prop export let dateFormat: Intl.DateTimeFormatOptions = { month: 'long', year: 'numeric' };
146
- @prop export let dayLabelFormat: 'short' | 'narrow' | 'long' = 'short';
147
- @prop export let customClass: string = '';
148
- @prop export let primaryColor: Button['color'] = 'blue';
149
- @prop export let secondaryColor: string = 'gray';
150
- -->
@@ -1,55 +0,0 @@
1
- import { SvelteComponentTyped } from "svelte";
2
- import { Button } from '..';
3
- declare const __propDef: {
4
- props: {
5
- currentDate?: Date;
6
- open?: boolean;
7
- locale?: string;
8
- firstDayOfWeek?: number;
9
- showToday?: boolean;
10
- showClose?: boolean;
11
- dateFormat?: Intl.DateTimeFormatOptions;
12
- dayLabelFormat?: "short" | "narrow" | "long";
13
- customClass?: string;
14
- primaryColor?: Button["color"];
15
- secondaryColor?: string;
16
- setDate?: (date: Date) => void;
17
- nextMonth?: () => void;
18
- previousMonth?: () => void;
19
- setMonth?: (month: number) => void;
20
- setYear?: (year: number) => void;
21
- };
22
- events: {
23
- selectDay: CustomEvent<any>;
24
- close: CustomEvent<any>;
25
- } & {
26
- [evt: string]: CustomEvent<any>;
27
- };
28
- slots: {};
29
- };
30
- export type DateCalenderProps = typeof __propDef.props;
31
- export type DateCalenderEvents = typeof __propDef.events;
32
- export type DateCalenderSlots = typeof __propDef.slots;
33
- /**
34
- * [Go to docs](https://flowbite-svelte.com/)
35
- * ## Props
36
- * @prop export let currentDate: Date = new Date();
37
- * @prop export let open = false;
38
- * @prop export let locale: string = 'default';
39
- * @prop export let firstDayOfWeek: number = 0;
40
- * @prop export let showToday: boolean = true;
41
- * @prop export let showClose: boolean = true;
42
- * @prop export let dateFormat: Intl.DateTimeFormatOptions = { month: 'long', year: 'numeric' };
43
- * @prop export let dayLabelFormat: 'short' | 'narrow' | 'long' = 'short';
44
- * @prop export let customClass: string = '';
45
- * @prop export let primaryColor: Button['color'] = 'blue';
46
- * @prop export let secondaryColor: string = 'gray';
47
- */
48
- export default class DateCalender extends SvelteComponentTyped<DateCalenderProps, DateCalenderEvents, DateCalenderSlots> {
49
- get setDate(): (date: Date) => void;
50
- get nextMonth(): () => void;
51
- get previousMonth(): () => void;
52
- get setMonth(): (month: number) => void;
53
- get setYear(): (year: number) => void;
54
- }
55
- export {};