flowbite-svelte 1.0.0-next.5 → 1.0.0-next.7

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
@@ -1,12 +1,12 @@
1
1
  # FLOWBITE-SVELTE
2
2
 
3
- [![npm version](https://badgen.net/npm/v/flowbite-svelte-next)](https://www.npmjs.com/package/flowbite-svelte-next) [![npm downloads](https://badgen.net/npm/dw/flowbite-svelte-next)](https://www.npmjs.com/package/flowbite-svelte-next) [![npm downloads](https://badgen.net/npm/dt/flowbite-svelte-next)](https://www.npmjs.com/package/flowbite-svelte-next) [![license](https://badgen.net/npm/license/flowbite-svelte-next)](https://github.com/themesberg/flowbite-svelte-next/blob/main/LICENSE) [![Discord](https://img.shields.io/discord/902911619032576090?color=%237289da&label=Discord)](https://discord.com/invite/4eeurUVvTy)
3
+ [![npm version](https://badgen.net/npm/v/flowbite-svelte-next)](https://www.npmjs.com/package/flowbite-svelte-next) [![npm downloads](https://badgen.net/npm/dw/flowbite-svelte-next)](https://www.npmjs.com/package/flowbite-svelte-next) [![npm downloads](https://badgen.net/npm/dt/flowbite-svelte-next)](https://www.npmjs.com/package/flowbite-svelte-next) [![license](https://badgen.net/npm/license/flowbite-svelte-next)](https://github.com/themesberg/flowbite-svelte/blob/main/LICENSE) [![Discord](https://img.shields.io/discord/902911619032576090?color=%237289da&label=Discord)](https://discord.com/invite/4eeurUVvTy)
4
4
 
5
5
  **⚠️ Flowbite Svelte is currently in early development and APIs and packages are likely to change quite often.**
6
6
 
7
7
  <p>
8
8
  <a href="https://flowbite-svelte-next.com" >
9
- <img alt="Flowbite Svelte UI components" width="350" src="https://raw.githubusercontent.com/themesberg/flowbite-svelte-next/main/static/images/flowbite-svelte-next.png">
9
+ <img alt="Flowbite Svelte UI components" width="350" src="https://raw.githubusercontent.com/themesberg/flowbite-svelte/main/static/images/flowbite-svelte-next.png">
10
10
  </a><br>
11
11
  Build websites even faster with Svelte components on top of Tailwind CSS
12
12
  </p>
@@ -9,7 +9,7 @@
9
9
  import type { BaseThemes } from "../theme";
10
10
  import clsx from "clsx";
11
11
 
12
- let { children, header, arrowup, arrowdown, open = $bindable(false), activeClass, inactiveClass, transition = slide, params, class: className }: Props = $props();
12
+ let { children, header, arrowup, arrowdown, open = $bindable(false), activeClass, inactiveClass, transitionType = slide, transitionParams, class: className }: Props = $props();
13
13
 
14
14
  // Theme context
15
15
  const context = getContext<BaseThemes>("themeConfig");
@@ -56,7 +56,7 @@
56
56
  </button>
57
57
  </h2>
58
58
  {#if open}
59
- <div transition:transition={params as ParamsType}>
59
+ <div transition:transitionType={transitionParams as ParamsType}>
60
60
  <div class={content()}>
61
61
  {@render children()}
62
62
  </div>
@@ -74,7 +74,7 @@
74
74
  @props:open: any = $bindable(false);
75
75
  @props:activeClass: any;
76
76
  @props:inactiveClass: any;
77
- @props:transition: any = slide;
78
- @props:params: any;
77
+ @props:transitionType: any = slide;
78
+ @props:transitionParams: any;
79
79
  @props:class: string;
80
80
  -->
@@ -9,8 +9,8 @@ import { type AccordionItemProps as Props } from ".";
9
9
  * @props:open: any = $bindable(false);
10
10
  * @props:activeClass: any;
11
11
  * @props:inactiveClass: any;
12
- * @props:transition: any = slide;
13
- * @props:params: any;
12
+ * @props:transitionType: any = slide;
13
+ * @props:transitionParams: any;
14
14
  * @props:class: string;
15
15
  */
16
16
  declare const AccordionItem: import("svelte").Component<Props, {}, "open">;
@@ -29,7 +29,7 @@ interface AccordionItemProps extends HTMLAttributes<HTMLDivElement> {
29
29
  open?: boolean;
30
30
  activeClass?: string;
31
31
  inactiveClass?: string;
32
- transition?: TransitionFunc;
33
- params?: ParamsType;
32
+ transitionType?: TransitionFunc;
33
+ transitionParams?: ParamsType;
34
34
  }
35
35
  export type { AccordionCtxType, AccordionProps, AccordionItemProps };
@@ -296,16 +296,16 @@ export declare const bottomNavItem: import("tailwind-variants").TVReturnType<{
296
296
  }, undefined, unknown, unknown, undefined>>;
297
297
  export declare const bottomnavheader: import("tailwind-variants").TVReturnType<{
298
298
  [key: string]: {
299
- [key: string]: import("tailwind-merge").ClassNameValue | {
300
- innerDiv?: import("tailwind-merge").ClassNameValue;
301
- outerDiv?: import("tailwind-merge").ClassNameValue;
299
+ [key: string]: import("tailwind-variants").ClassValue | {
300
+ innerDiv?: import("tailwind-variants").ClassValue;
301
+ outerDiv?: import("tailwind-variants").ClassValue;
302
302
  };
303
303
  };
304
304
  } | {
305
305
  [x: string]: {
306
- [x: string]: import("tailwind-merge").ClassNameValue | {
307
- innerDiv?: import("tailwind-merge").ClassNameValue;
308
- outerDiv?: import("tailwind-merge").ClassNameValue;
306
+ [x: string]: import("tailwind-variants").ClassValue | {
307
+ innerDiv?: import("tailwind-variants").ClassValue;
308
+ outerDiv?: import("tailwind-variants").ClassValue;
309
309
  };
310
310
  };
311
311
  } | {}, {
@@ -313,9 +313,9 @@ export declare const bottomnavheader: import("tailwind-variants").TVReturnType<{
313
313
  outerDiv: string;
314
314
  }, undefined, {
315
315
  [key: string]: {
316
- [key: string]: import("tailwind-merge").ClassNameValue | {
317
- innerDiv?: import("tailwind-merge").ClassNameValue;
318
- outerDiv?: import("tailwind-merge").ClassNameValue;
316
+ [key: string]: import("tailwind-variants").ClassValue | {
317
+ innerDiv?: import("tailwind-variants").ClassValue;
318
+ outerDiv?: import("tailwind-variants").ClassValue;
319
319
  };
320
320
  };
321
321
  } | {}, {
@@ -4,6 +4,7 @@
4
4
  import { Button, clickOutside, type ButtonProps } from "..";
5
5
  import type { DatepickerProps as Props } from "./type";
6
6
  import { datepicker } from "./theme";
7
+ import ToolbarButton from "../toolbar/ToolbarButton.svelte";
7
8
 
8
9
  let {
9
10
  value = $bindable(),
@@ -193,11 +194,11 @@
193
194
  </script>
194
195
 
195
196
  {#snippet navButton(forward: boolean)}
196
- <Button onclick={() => changeMonth(forward ? 1 : -1)} {color} size="sm" aria-label={forward ? "Next month" : "Previous month"}>
197
- <svg class="h-3 w-3 text-white rtl:rotate-180 dark:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 10">
197
+ <ToolbarButton color="dark" onclick={() => changeMonth(forward ? 1 : -1)} size="lg" aria-label={forward ? "Next month" : "Previous month"}>
198
+ <svg class="h-3 w-3 rtl:rotate-180" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 10">
198
199
  <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d={forward ? "M1 5h12m0 0L9 1m4 4L9 9" : "M13 5H1m0 0 4 4M1 5l4-4"}></path>
199
200
  </svg>
200
- </Button>
201
+ </ToolbarButton>
201
202
  {/snippet}
202
203
 
203
204
  <div bind:this={datepickerContainerElement} class={["relative", inline && "inline-block"]}>
@@ -214,35 +215,34 @@
214
215
 
215
216
  {#if isOpen || inline}
216
217
  <div bind:this={calendarRef} id="datepicker-dropdown" class={base({ inline })} transition:fade={{ duration: 100 }} role="dialog" aria-label="Calendar">
217
- <div class="p-4" role="application">
218
- {#if title}
219
- <h2 class={titleVariant()}>{title}</h2>
220
- {/if}
221
- <div class={nav()}>
222
- {@render navButton(false)}
223
- <h3 class={polite()} aria-live="polite">
224
- {currentMonth.toLocaleString(locale, { month: "long", year: "numeric" })}
225
- </h3>
226
- {@render navButton(true)}
227
- </div>
228
- <div class={grid()} role="grid">
229
- {#each weekdays as day}
230
- <div class={columnHeader} role="columnheader">{day}</div>
231
- {/each}
232
- {#each daysInMonth as day}
233
- <Button color={isSelected(day) ? color : "alternative"} size="sm" class={dayButton({ current: day.getMonth() !== currentMonth.getMonth(), today: isToday(day), color: isInRange(day) ? color : undefined })} onclick={() => handleDaySelect(day)} onkeydown={handleCalendarKeydown} aria-label={day.toLocaleDateString(locale, { weekday: "long", year: "numeric", month: "long", day: "numeric" })} aria-selected={isSelected(day)} role="gridcell">
234
- {day.getDate()}
235
- </Button>
236
- {/each}
237
- </div>
238
- {#if showActionButtons}
239
- <div class={actionButtons()}>
240
- <Button onclick={() => handleDaySelect(new Date())} {color} size="sm">Today</Button>
241
- <Button onclick={handleClear} color="red" size="sm">Clear</Button>
242
- <Button onclick={handleApply} {color} size="sm">Apply</Button>
243
- </div>
244
- {/if}
218
+ {#if title}
219
+ <h2 class={titleVariant()}>{title}</h2>
220
+ {/if}
221
+ <div class={nav()}>
222
+ {@render navButton(false)}
223
+ <h3 class={polite()} aria-live="polite">
224
+ {currentMonth.toLocaleString(locale, { month: "long", year: "numeric" })}
225
+ </h3>
226
+ {@render navButton(true)}
245
227
  </div>
228
+ <div class={grid()} role="grid">
229
+ {#each weekdays as day}
230
+ <div class={columnHeader()} role="columnheader">{day}</div>
231
+ {/each}
232
+ {#each daysInMonth as day}
233
+ {@const current = day.getMonth() !== currentMonth.getMonth()}
234
+ <button color={isSelected(day) ? color : "alternative"} class={dayButton({ current, today: isToday(day), color: isInRange(day) ? color : undefined })} onclick={() => handleDaySelect(day)} onkeydown={handleCalendarKeydown} aria-label={day.toLocaleDateString(locale, { weekday: "long", year: "numeric", month: "long", day: "numeric" })} aria-selected={isSelected(day)} role="gridcell">
235
+ {day.getDate()}
236
+ </button>
237
+ {/each}
238
+ </div>
239
+ {#if showActionButtons}
240
+ <div class={actionButtons()}>
241
+ <Button onclick={() => handleDaySelect(new Date())} {color} size="sm">Today</Button>
242
+ <Button onclick={handleClear} color="red" size="sm">Clear</Button>
243
+ <Button onclick={handleApply} {color} size="sm">Apply</Button>
244
+ </div>
245
+ {/if}
246
246
  </div>
247
247
  {/if}
248
248
  </div>
@@ -112,10 +112,10 @@ export declare const datepicker: import("tailwind-variants").TVReturnType<{
112
112
  base: string;
113
113
  input: string;
114
114
  titleVariant: string;
115
+ polite: string;
115
116
  button: string;
116
117
  actionButtons: string;
117
118
  columnHeader: string;
118
- polite: string;
119
119
  grid: string;
120
120
  nav: string;
121
121
  dayButton: string;
@@ -233,10 +233,10 @@ export declare const datepicker: import("tailwind-variants").TVReturnType<{
233
233
  base: string;
234
234
  input: string;
235
235
  titleVariant: string;
236
+ polite: string;
236
237
  button: string;
237
238
  actionButtons: string;
238
239
  columnHeader: string;
239
- polite: string;
240
240
  grid: string;
241
241
  nav: string;
242
242
  dayButton: string;
@@ -354,10 +354,10 @@ export declare const datepicker: import("tailwind-variants").TVReturnType<{
354
354
  base: string;
355
355
  input: string;
356
356
  titleVariant: string;
357
+ polite: string;
357
358
  button: string;
358
359
  actionButtons: string;
359
360
  columnHeader: string;
360
- polite: string;
361
361
  grid: string;
362
362
  nav: string;
363
363
  dayButton: string;
@@ -1,16 +1,16 @@
1
1
  import { tv } from "tailwind-variants";
2
2
  export const datepicker = tv({
3
3
  slots: {
4
- base: "rounded-md bg-white shadow-lg dark:bg-gray-800",
4
+ base: "inline-block rounded-lg bg-white dark:bg-gray-700 shadow-lg p-4",
5
5
  input: "w-full rounded-md border px-4 py-2 text-sm focus:ring-2 focus:outline-none outline-none dark:border-gray-600 dark:bg-gray-700 dark:text-white",
6
- titleVariant: "mb-4 text-lg font-semibold dark:text-white",
6
+ titleVariant: "mb-2 text-lg font-semibold text-gray-900 dark:text-white",
7
+ polite: "text-sm rounded-lg text-gray-900 dark:text-white bg-white dark:bg-gray-700 font-semibold py-2.5 px-5 hover:bg-gray-100 dark:hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-gray-200",
7
8
  button: "absolute inset-y-0 right-0 flex items-center px-3 text-gray-500 focus:outline-hidden dark:text-gray-400",
8
9
  actionButtons: "mt-4 flex justify-between",
9
10
  columnHeader: "text-center text-sm font-medium text-gray-500 dark:text-gray-400",
10
- polite: "text-lg font-semibold dark:text-white",
11
- grid: "grid grid-cols-7 gap-1",
11
+ grid: "grid grid-cols-7 gap-1 w-64",
12
12
  nav: "mb-4 flex items-center justify-between",
13
- dayButton: "h-8 w-full"
13
+ dayButton: "h-8 w-full hover:bg-gray-100 dark:hover:bg-gray-600 block flex-1 leading-9 border-0 rounded-lg cursor-pointer text-center text-gray-900 dark:text-white font-semibold text-sm day"
14
14
  },
15
15
  variants: {
16
16
  color: {
@@ -42,7 +42,7 @@ export const datepicker = tv({
42
42
  false: { base: "absolute z-10 mt-1" }
43
43
  },
44
44
  current: {
45
- true: { dayButton: "text-gray-300 dark:text-gray-600" }
45
+ true: { dayButton: "text-gray-400 dark:text-gray-500" }
46
46
  },
47
47
  today: {
48
48
  true: { dayButton: "font-bold" }