flowbite-svelte 0.47.2 → 0.47.3

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.
@@ -1,6 +1,7 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
2
  import type { HTMLAttributes } from 'svelte/elements';
3
3
  import { type TransitionConfig } from 'svelte/transition';
4
+ import type { ParamsType } from '../types';
4
5
  declare const __propDef: {
5
6
  props: HTMLAttributes<HTMLDivElement> & {
6
7
  position?: "static" | "fixed" | "absolute" | "relative" | "sticky";
@@ -9,7 +10,7 @@ declare const __propDef: {
9
10
  divClass?: string;
10
11
  innerClass?: string;
11
12
  bannerStatus?: boolean;
12
- transition?: (node: HTMLElement, params: any) => TransitionConfig;
13
+ transition?: (node: HTMLElement, params: ParamsType) => TransitionConfig;
13
14
  params?: object;
14
15
  classDiv?: string;
15
16
  classInner?: string;
@@ -107,6 +107,10 @@ $: buttonClass = twMerge(
107
107
  <a {href} {...$$restProps} class={buttonClass} role="button" on:click on:change on:keydown on:keyup on:touchstart|passive on:touchend on:touchcancel on:mouseenter on:mouseleave>
108
108
  <slot />
109
109
  </a>
110
+ {:else if tag === 'label'}
111
+ <label {...$$restProps} class={buttonClass}>
112
+ <slot />
113
+ </label>
110
114
  {:else if tag === 'button' }
111
115
  <button {type} {...$$restProps} {disabled} class={buttonClass} on:click on:change on:keydown on:keyup on:touchstart|passive on:touchend on:touchcancel on:mouseenter on:mouseleave>
112
116
  <slot />
@@ -7,7 +7,7 @@ declare const __propDef: {
7
7
  size?: "xs" | "sm" | "md" | "lg" | "xl";
8
8
  color?: "red" | "yellow" | "green" | "purple" | "blue" | "light" | "dark" | "primary" | "none" | "alternative";
9
9
  shadow?: boolean;
10
- tag?: "a" | "button";
10
+ tag?: "a" | "button" | "label";
11
11
  checked?: boolean;
12
12
  } & Omit<HTMLAnchorAttributes, "type"> & {
13
13
  href?: string | undefined;
@@ -17,7 +17,7 @@ declare const __propDef: {
17
17
  size?: "xs" | "sm" | "md" | "lg" | "xl";
18
18
  color?: "red" | "yellow" | "green" | "purple" | "blue" | "light" | "dark" | "primary" | "none" | "alternative";
19
19
  shadow?: boolean;
20
- tag?: "a" | "button";
20
+ tag?: "a" | "button" | "label";
21
21
  checked?: boolean;
22
22
  } & HTMLButtonAttributes & {
23
23
  disabled?: HTMLButtonAttributes["disabled"];
@@ -11,13 +11,14 @@ import type { TransitionConfig } from 'svelte/transition';
11
11
  import Controls from './Controls.svelte';
12
12
  import Indicators from './Indicators.svelte';
13
13
  import Slide from './Slide.svelte';
14
+ import type { ParamsType } from '../types';
14
15
  declare const __propDef: {
15
16
  props: {
16
17
  [x: string]: any;
17
18
  images: HTMLImgAttributes[];
18
19
  index?: number | undefined;
19
20
  slideDuration?: number | undefined;
20
- transition?: (((node: HTMLElement, params: any) => TransitionConfig) | null) | undefined;
21
+ transition?: (((node: HTMLElement, params: ParamsType) => TransitionConfig) | null) | undefined;
21
22
  duration?: number | undefined;
22
23
  ariaLabel?: string | undefined;
23
24
  disableSwipe?: boolean | undefined;
@@ -1,11 +1,12 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
2
  import type { HTMLImgAttributes } from 'svelte/elements';
3
3
  import { type TransitionConfig } from 'svelte/transition';
4
+ import type { ParamsType } from '../types';
4
5
  declare const __propDef: {
5
6
  props: {
6
7
  [x: string]: any;
7
8
  image: HTMLImgAttributes;
8
- transition?: (((node: HTMLElement, params: any) => TransitionConfig) | null) | undefined;
9
+ transition?: (((node: HTMLElement, params: ParamsType) => TransitionConfig) | null) | undefined;
9
10
  };
10
11
  events: {
11
12
  [evt: string]: CustomEvent<any>;
@@ -23,7 +23,6 @@ $: index = (index + images.length) % images.length;
23
23
  <div class={twMerge('flex flex-row justify-center bg-gray-100 w-full', $$props.class)}>
24
24
  {#each images as image, idx}
25
25
  {@const selected = index === idx}
26
- <!-- svelte-ignore a11y-click-events-have-key-events -->
27
26
  <button on:click={() => btnClick(idx)} aria-label={ariaLabel}>
28
27
  <slot {Thumbnail} {image} {selected} {imgClass}>
29
28
  <Thumbnail {...image} {selected} class={imgClass} />
@@ -21,6 +21,7 @@ export let title = "";
21
21
  const dispatch = createEventDispatcher();
22
22
  let isOpen = inline;
23
23
  let inputElement;
24
+ let datepickerContainerElement;
24
25
  let currentMonth = value || defaultDate || /* @__PURE__ */ new Date();
25
26
  let focusedDate = null;
26
27
  let calendarRef;
@@ -128,7 +129,7 @@ function handleInputChange() {
128
129
  }
129
130
  }
130
131
  function handleClickOutside(event) {
131
- if (isOpen && !inputElement.contains(event.target)) {
132
+ if (isOpen && datepickerContainerElement && !datepickerContainerElement.contains(event.target)) {
132
133
  isOpen = false;
133
134
  }
134
135
  }
@@ -212,7 +213,7 @@ function handleApply() {
212
213
  }
213
214
  </script>
214
215
 
215
- <div class="relative {inline ? 'inline-block' : ''}">
216
+ <div bind:this={datepickerContainerElement} class="relative {inline ? 'inline-block' : ''}">
216
217
  {#if !inline}
217
218
  <div class="relative">
218
219
  <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" />
@@ -7,7 +7,7 @@ declare const __propDef: {
7
7
  size?: "xs" | "sm" | "md" | "lg" | "xl";
8
8
  color?: "red" | "yellow" | "green" | "purple" | "blue" | "light" | "dark" | "primary" | "none" | "alternative";
9
9
  shadow?: boolean;
10
- tag?: "a" | "button";
10
+ tag?: "a" | "button" | "label";
11
11
  checked?: boolean;
12
12
  } & Omit<import("svelte/elements").HTMLAnchorAttributes, "type"> & {
13
13
  href?: string | undefined;
@@ -17,7 +17,7 @@ declare const __propDef: {
17
17
  size?: "xs" | "sm" | "md" | "lg" | "xl";
18
18
  color?: "red" | "yellow" | "green" | "purple" | "blue" | "light" | "dark" | "primary" | "none" | "alternative";
19
19
  shadow?: boolean;
20
- tag?: "a" | "button";
20
+ tag?: "a" | "button" | "label";
21
21
  checked?: boolean;
22
22
  } & import("svelte/elements").HTMLButtonAttributes & {
23
23
  disabled?: import("svelte/elements").HTMLButtonAttributes["disabled"];
@@ -1,12 +1,41 @@
1
1
  <script>import { twMerge } from "tailwind-merge";
2
2
  import Input from "./Input.svelte";
3
+ import { CloseButton } from "..";
3
4
  export let files = void 0;
4
5
  export let inputClass = "border !p-0 dark:text-gray-400";
6
+ export let clearable = false;
7
+ export let size = "md";
8
+ const base = "block w-full disabled:cursor-not-allowed disabled:opacity-50 rtl:text-right p-2.5 focus:border-primary-500 focus:ring-primary-500 dark:focus:border-primary-500 dark:focus:ring-primary-500 bg-gray-50 text-gray-900 dark:bg-gray-700 dark:placeholder-gray-400 border-gray-300 dark:border-gray-600 text-sm rounded-lg border !p-0 dark:text-gray-400";
9
+ const wrapper = "relative w-full";
10
+ const right = "flex absolute inset-y-0 items-center text-gray-500 dark:text-gray-400 end-0 p-2.5";
11
+ const sizes = {
12
+ sm: "text-xs ps-9 pe-9 p-2",
13
+ md: "text-sm ps-10 pe-10 p-2.5",
14
+ lg: "sm:text-base ps-11 pe-11 p-3"
15
+ };
16
+ let fileInputRef;
17
+ const clearAll = () => {
18
+ if (fileInputRef) {
19
+ fileInputRef.value = "";
20
+ files = void 0;
21
+ }
22
+ };
23
+ $: hasFiles = files && files.length > 0;
24
+ let inputCls = twMerge(base, sizes[size ?? "md"], inputClass);
5
25
  </script>
6
26
 
7
- <Input {...$$restProps} class={twMerge(inputClass, $$props.class)} let: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} />
9
- </Input>
27
+ {#if clearable}
28
+ <div class={wrapper}>
29
+ <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 {...$$restProps} class={inputCls} bind:this={fileInputRef} />
30
+ {#if hasFiles}
31
+ <CloseButton on:click={clearAll} class={right} />
32
+ {/if}
33
+ </div>
34
+ {:else}
35
+ <Input {...$$restProps} class={twMerge(inputClass, $$props.class)} let:props>
36
+ <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} />
37
+ </Input>
38
+ {/if}
10
39
 
11
40
  <!--
12
41
  @component
@@ -14,4 +43,6 @@ export let inputClass = "border !p-0 dark:text-gray-400";
14
43
  ## Props
15
44
  @prop export let files: $$Props['files'] = undefined;
16
45
  @prop export let inputClass: $$Props['inputClass'] = 'border !p-0 dark:text-gray-400';
46
+ @prop export let clearable: $$Props['clearable'] = false;
47
+ @prop export let size: $$Props['size'] = 'md';
17
48
  -->
@@ -13,6 +13,8 @@ declare const __propDef: {
13
13
  } & {
14
14
  files?: FileList | undefined;
15
15
  inputClass?: string;
16
+ clearable?: boolean;
17
+ size?: "sm" | "md" | "lg";
16
18
  };
17
19
  events: {
18
20
  change: Event;
@@ -39,6 +41,8 @@ export type FileuploadSlots = typeof __propDef.slots;
39
41
  * ## Props
40
42
  * @prop export let files: $$Props['files'] = undefined;
41
43
  * @prop export let inputClass: $$Props['inputClass'] = 'border !p-0 dark:text-gray-400';
44
+ * @prop export let clearable: $$Props['clearable'] = false;
45
+ * @prop export let size: $$Props['size'] = 'md';
42
46
  */
43
47
  export default class Fileupload extends SvelteComponentTyped<FileuploadProps, FileuploadEvents, FileuploadSlots> {
44
48
  }
@@ -8,7 +8,7 @@ declare const __propDef: {
8
8
  type?: InputType;
9
9
  size?: "small" | "default";
10
10
  color?: "base" | "green" | "red";
11
- value?: any;
11
+ value?: string | number | readonly string[] | undefined;
12
12
  classDiv?: string;
13
13
  classInput?: string;
14
14
  classLabel?: string;
@@ -17,7 +17,6 @@ $: labelClass = twMerge(defaultClass, colorClasses[color], $$props.class);
17
17
  </script>
18
18
 
19
19
  {#if show}
20
- <!-- svelte-ignore a11y-label-has-associated-control -->
21
20
  <label bind:this={node} {...$$restProps} class={labelClass}><slot /></label>
22
21
  {:else}
23
22
  <slot />
@@ -105,7 +105,6 @@ function handleKeyDown(event) {
105
105
  <option {value} {disabled}>{name}</option>
106
106
  {/each}
107
107
  </select>
108
- <!-- svelte-ignore a11y-click-events-have-key-events -->
109
108
  <div on:click={() => !disabled && (show = !show)} on:focusout={() => !disabled && (show = false)} on:keydown={handleKeyDown} tabindex="0" role="listbox" class={twMerge(multiSelectClass, sizes[size], $$props.class, !disabled && "focus-within:ring-1 focus-within:border-primary-500 dark:focus-within:border-primary-500", disabled && "opacity-50 cursor-not-allowed")}>
110
109
  {#if !selectItems.length}
111
110
  <span class="text-gray-400">{placeholder}</span>
@@ -134,7 +133,6 @@ function handleKeyDown(event) {
134
133
  {#if show}
135
134
  <div on:click|stopPropagation role="presentation" class={multiSelectDropdown}>
136
135
  {#each items as item (item.name)}
137
- <!-- svelte-ignore a11y-click-events-have-key-events -->
138
136
  <div on:click={() => selectOption(item)} role="presentation" class={twMerge(itemsClass, selectItems.includes(item) && itemsSelectClass, activeItem === item && activeItemClass, disabled && "pointer-events-none", item.disabled && "opacity-50 cursor-not-allowed")}>
139
137
  {item.name}
140
138
  </div>
@@ -30,7 +30,7 @@ $: if (checked && group === void 0) {
30
30
  </script>
31
31
 
32
32
  <Label class={labelClass(inline, $$props.class)} show={$$slots.default}>
33
- <input type="radio" bind:group={group} on:blur on:change on:click on:focus on:keydown on:keypress on:keyup on:mouseenter on:mouseleave on:mouseover on:paste {value} {...$$restProps} class={inputClass(custom, color, false, background, spacing, $$slots.default || $$props.class)} />
33
+ <input type="radio" {...$$restProps} bind:group={group} on:blur on:change on:click on:focus on:keydown on:keypress on:keyup on:mouseenter on:mouseleave on:mouseover on:paste {value} class={inputClass(custom, color, false, background, spacing, $$slots.default || $$props.class)} />
34
34
  <slot />
35
35
  </Label>
36
36
 
@@ -12,7 +12,7 @@ let buttonClass;
12
12
  $: buttonClass = twMerge(inline ? "inline-flex" : "flex", $$props.class);
13
13
  </script>
14
14
 
15
- <Button checked={value === group} {pill} {outline} {size} {color} {shadow} class={buttonClass}>
15
+ <Button tag="label" checked={value === group} {pill} {outline} {size} {color} {shadow} class={buttonClass}>
16
16
  <input
17
17
  type="radio"
18
18
  bind:group
@@ -2,7 +2,7 @@ import { SvelteComponentTyped } from "svelte";
2
2
  import type { HTMLTextareaAttributes } from 'svelte/elements';
3
3
  declare const __propDef: {
4
4
  props: HTMLTextareaAttributes & {
5
- value?: any;
5
+ value?: string;
6
6
  wrappedClass?: string;
7
7
  unWrappedClass?: string;
8
8
  innerWrappedClass?: string;
@@ -7,6 +7,7 @@ export let value = "";
7
7
  export let checked = void 0;
8
8
  export let customSize = "";
9
9
  export let classDiv = "";
10
+ export let disabled = false;
10
11
  let background = getContext("background");
11
12
  const common = "me-3 shrink-0 bg-gray-200 rounded-full peer-focus:ring-4 peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:bg-white after:border-gray-300 after:border after:rounded-full after:transition-all";
12
13
  const colors = {
@@ -28,9 +29,11 @@ const sizes = {
28
29
  };
29
30
  let divClass;
30
31
  $: divClass = twMerge(common, $$slots.offLabel ? "ms-3" : "", background ? "dark:bg-gray-600 dark:border-gray-500" : "dark:bg-gray-700 dark:border-gray-600", colors[$$restProps.color ?? "primary"], sizes[size], "relative", classDiv);
32
+ let checkboxCls;
33
+ $: checkboxCls = disabled ? "cursor-not-allowed grayscale contrast-50 text-gray-400" : "cursor-pointer text-gray-900";
31
34
  </script>
32
35
 
33
- <Checkbox custom {...$$restProps} class={$$props.class} {value} bind:checked bind:group on:click on:change>
36
+ <Checkbox custom {...$$restProps} {disabled} class={twMerge(checkboxCls, $$props.class)} {value} bind:checked bind:group on:click on:change>
34
37
  <slot name="offLabel"></slot>
35
38
  <span class={divClass}></span>
36
39
  <slot></slot>
@@ -46,4 +49,5 @@ $: divClass = twMerge(common, $$slots.offLabel ? "ms-3" : "", background ? "dark
46
49
  @prop export let checked: $$Props['checked'] = undefined;
47
50
  @prop export let customSize: $$Props['customSize'] = '';
48
51
  @prop export let classDiv: string = '';
52
+ @prop export let disabled: $$Props['disabled'] = false;
49
53
  -->
@@ -21,6 +21,7 @@ declare const __propDef: {
21
21
  checked?: boolean;
22
22
  customSize?: string;
23
23
  classDiv?: string;
24
+ disabled?: boolean;
24
25
  };
25
26
  events: {
26
27
  click: MouseEvent;
@@ -45,6 +46,7 @@ export type ToggleSlots = typeof __propDef.slots;
45
46
  * @prop export let checked: $$Props['checked'] = undefined;
46
47
  * @prop export let customSize: $$Props['customSize'] = '';
47
48
  * @prop export let classDiv: string = '';
49
+ * @prop export let disabled: $$Props['disabled'] = false;
48
50
  */
49
51
  export default class Toggle extends SvelteComponentTyped<ToggleProps, ToggleEvents, ToggleSlots> {
50
52
  }
@@ -19,7 +19,6 @@ $: defaultClass = twMerge(
19
19
  );
20
20
  </script>
21
21
 
22
- <!-- svelte-ignore a11y-click-events-have-key-events -->
23
22
  <svelte:element this={href ? 'a' : 'button'} {href} class={defaultClass} on:blur on:change on:click on:focus on:keydown on:keypress on:keyup on:mouseenter on:mouseleave on:mouseover role={href ? 'button' : undefined}>
24
23
  <slot />
25
24
  </svelte:element>
@@ -12,7 +12,7 @@ declare const __propDef: {
12
12
  size?: "xs" | "sm" | "md" | "lg" | "xl";
13
13
  color?: "red" | "yellow" | "green" | "purple" | "blue" | "light" | "dark" | "primary" | "none" | "alternative";
14
14
  shadow?: boolean;
15
- tag?: "a" | "button";
15
+ tag?: "a" | "button" | "label";
16
16
  checked?: boolean;
17
17
  } & Omit<import("svelte/elements").HTMLAnchorAttributes, "type"> & {
18
18
  href?: string | undefined;
@@ -22,7 +22,7 @@ declare const __propDef: {
22
22
  size?: "xs" | "sm" | "md" | "lg" | "xl";
23
23
  color?: "red" | "yellow" | "green" | "purple" | "blue" | "light" | "dark" | "primary" | "none" | "alternative";
24
24
  shadow?: boolean;
25
- tag?: "a" | "button";
25
+ tag?: "a" | "button" | "label";
26
26
  checked?: boolean;
27
27
  } & import("svelte/elements").HTMLButtonAttributes & {
28
28
  disabled?: import("svelte/elements").HTMLButtonAttributes["disabled"];
@@ -7,7 +7,7 @@ declare const __propDef: {
7
7
  size?: "xs" | "sm" | "md" | "lg" | "xl";
8
8
  color?: "red" | "yellow" | "green" | "purple" | "blue" | "light" | "dark" | "primary" | "none" | "alternative";
9
9
  shadow?: boolean;
10
- tag?: "a" | "button";
10
+ tag?: "a" | "button" | "label";
11
11
  checked?: boolean;
12
12
  } & Omit<import("svelte/elements").HTMLAnchorAttributes, "type"> & {
13
13
  href?: string | undefined;
@@ -17,7 +17,7 @@ declare const __propDef: {
17
17
  size?: "xs" | "sm" | "md" | "lg" | "xl";
18
18
  color?: "red" | "yellow" | "green" | "purple" | "blue" | "light" | "dark" | "primary" | "none" | "alternative";
19
19
  shadow?: boolean;
20
- tag?: "a" | "button";
20
+ tag?: "a" | "button" | "label";
21
21
  checked?: boolean;
22
22
  } & import("svelte/elements").HTMLButtonAttributes & {
23
23
  disabled?: import("svelte/elements").HTMLButtonAttributes["disabled"];
@@ -33,11 +33,13 @@ const currentStepColors = {
33
33
  blue: "bg-blue-800 dark:bg-blue-400",
34
34
  custom: currentCustom
35
35
  };
36
+ $: safeCurrentStep = Math.max(1, Math.min(currentStep, steps.length));
37
+ $: currentStepLabel = steps[safeCurrentStep - 1] ?? "Unknown Step";
36
38
  </script>
37
39
 
38
40
  <div {...$$restProps} class={twMerge('space-y-2 dark:text-white', $$props.class)}>
39
41
  {#if !hideLabel}
40
- <h3 class="text-base font-semibold">{steps[currentStep - 1]}</h3>
42
+ <h3 class="text-base font-semibold">{currentStepLabel}</h3>
41
43
  {/if}
42
44
  <div class={twJoin('flex justify-between gap-2 w-full', size)}>
43
45
  {#each steps as step, i}
@@ -61,12 +63,12 @@ const currentStepColors = {
61
63
  @component
62
64
  [Go to docs](https://flowbite-svelte.com/)
63
65
  ## Props
64
- @prop export let steps: $$Props['steps'] = ['Step 1', 'Step 2', 'Step 3', 'Step 4', 'Step 5'];
65
- @prop export let currentStep: $$Props['currentStep'] = 1;
66
- @prop export let size: $$Props['size'] = 'h-2.5';
67
- @prop export let color: $$Props['color'] = 'primary';
68
- @prop export let glow: $$Props['glow'] = false;
69
- @prop export let hideLabel: $$Props['hideLabel'] = false;
70
- @prop export let completedCustom: $$Props['completedCustom'] = '';
71
- @prop export let currentCustom: $$Props['currentCustom'] = '';
66
+ @prop export let steps = ['Step 1', 'Step 2', 'Step 3', 'Step 4', 'Step 5'];
67
+ @prop export let currentStep = 1;
68
+ @prop export let size = 'h-2.5';
69
+ @prop export let color: ColorType = 'primary';
70
+ @prop export let glow = false;
71
+ @prop export let hideLabel = false;
72
+ @prop export let completedCustom = '';
73
+ @prop export let currentCustom = '';
72
74
  -->
@@ -4,12 +4,12 @@ declare const __propDef: {
4
4
  props: HTMLAttributes<HTMLElement> & {
5
5
  steps: string[];
6
6
  currentStep: number;
7
- size: string;
8
- color: "primary" | "secondary" | "gray" | "red" | "yellow" | "green" | "indigo" | "purple" | "pink" | "blue" | "custom";
9
- glow: boolean;
10
- hideLabel: boolean;
11
- completedCustom: string;
12
- currentCustom: string;
7
+ size?: string;
8
+ color?: "gray" | "red" | "yellow" | "green" | "indigo" | "purple" | "pink" | "blue" | "primary" | "secondary" | "custom";
9
+ glow?: boolean;
10
+ hideLabel?: boolean;
11
+ completedCustom?: string;
12
+ currentCustom?: string;
13
13
  };
14
14
  events: {
15
15
  [evt: string]: CustomEvent<any>;
@@ -22,14 +22,14 @@ export type StepIndicatorSlots = typeof __propDef.slots;
22
22
  /**
23
23
  * [Go to docs](https://flowbite-svelte.com/)
24
24
  * ## Props
25
- * @prop export let steps: $$Props['steps'] = ['Step 1', 'Step 2', 'Step 3', 'Step 4', 'Step 5'];
26
- * @prop export let currentStep: $$Props['currentStep'] = 1;
27
- * @prop export let size: $$Props['size'] = 'h-2.5';
28
- * @prop export let color: $$Props['color'] = 'primary';
29
- * @prop export let glow: $$Props['glow'] = false;
30
- * @prop export let hideLabel: $$Props['hideLabel'] = false;
31
- * @prop export let completedCustom: $$Props['completedCustom'] = '';
32
- * @prop export let currentCustom: $$Props['currentCustom'] = '';
25
+ * @prop export let steps = ['Step 1', 'Step 2', 'Step 3', 'Step 4', 'Step 5'];
26
+ * @prop export let currentStep = 1;
27
+ * @prop export let size = 'h-2.5';
28
+ * @prop export let color: ColorType = 'primary';
29
+ * @prop export let glow = false;
30
+ * @prop export let hideLabel = false;
31
+ * @prop export let completedCustom = '';
32
+ * @prop export let currentCustom = '';
33
33
  */
34
34
  export default class StepIndicator extends SvelteComponentTyped<StepIndicatorProps, StepIndicatorEvents, StepIndicatorSlots> {
35
35
  }
package/dist/types.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import type { HTMLAnchorAttributes, HTMLButtonAttributes } from 'svelte/elements';
2
+ import type { FadeParams, BlurParams, FlyParams, SlideParams, ScaleParams } from 'svelte/transition';
2
3
  export type BlockQuoteType = 'xs' | 'sm' | 'base' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' | '7xl' | '8xl' | '9xl';
3
4
  export type ButtonColorType = 'alternative' | 'blue' | 'dark' | 'green' | 'light' | 'primary' | 'purple' | 'red' | 'yellow' | 'none';
4
5
  export type CheckboxItem = {
@@ -16,6 +17,7 @@ export type IndicatorPlacementType = 'top-left' | 'top-center' | 'top-right' | '
16
17
  export type InputType = 'color' | 'date' | 'datetime-local' | 'email' | 'file' | 'hidden' | 'image' | 'month' | 'number' | 'password' | 'reset' | 'submit' | 'tel' | 'text' | 'time' | 'url' | 'week' | 'search';
17
18
  export type FormColorType = 'blue' | 'red' | 'green' | 'purple' | 'teal' | 'yellow' | 'orange' | 'primary' | 'secondary';
18
19
  export type ModalPlacementType = 'top-left' | 'top-center' | 'top-right' | 'center-left' | 'center' | 'center-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
20
+ export type ParamsType = FadeParams | BlurParams | FlyParams | SlideParams | ScaleParams;
19
21
  export type PsizeType = 'xs' | 'sm' | 'base' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' | '7xl' | '8xl' | '9xl';
20
22
  export type PweightType = 'thin' | 'extralight' | 'light' | 'normal' | 'medium' | 'semibold' | 'bold' | 'extrabold' | 'black';
21
23
  export type TableColorType = 'blue' | 'green' | 'red' | 'yellow' | 'purple' | 'indigo' | 'pink' | 'default' | 'custom';
@@ -2,18 +2,9 @@ import { createEventDispatcher } from 'svelte';
2
2
  export let open = false;
3
3
  const backdropClasses = 'bg-gray-900 bg-opacity-50 dark:bg-opacity-80 fixed inset-0 z-40';
4
4
  export let placement;
5
- // const placement:
6
- // | 'top-left'
7
- // | 'top-center'
8
- // | 'top-right'
9
- // | 'center-left'
10
- // | 'center'
11
- // | 'center-right'
12
- // | 'bottom-left'
13
- // | 'bottom-center'
14
- // | 'bottom-right'='center';
15
5
  export const init = (node, _open) => {
16
6
  getPlacementClasses().map((c) => node.classList.add(c));
7
+ /* eslint-disable @typescript-eslint/no-unused-expressions */
17
8
  _open && createBackdrop(node);
18
9
  return {
19
10
  update(_open) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flowbite-svelte",
3
- "version": "0.47.2",
3
+ "version": "0.47.3",
4
4
  "description": "Flowbite components for Svelte",
5
5
  "main": "dist/index.js",
6
6
  "author": {
@@ -15,19 +15,19 @@
15
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.1",
19
- "@sveltejs/adapter-vercel": "^5.4.5",
20
- "@sveltejs/kit": "^2.7.1",
21
- "@sveltejs/package": "2.3.2",
18
+ "@playwright/test": "^1.48.2",
19
+ "@sveltejs/adapter-vercel": "^5.4.6",
20
+ "@sveltejs/kit": "^2.7.3",
21
+ "@sveltejs/package": "2.3.7",
22
22
  "@sveltejs/vite-plugin-svelte": "^3.1.2",
23
23
  "@svitejs/changesets-changelog-github-compact": "^1.2.0",
24
- "@types/eslint": "^8.56.12",
24
+ "@types/eslint": "^9.6.1",
25
25
  "autoprefixer": "^10.4.20",
26
26
  "dayjs": "^1.11.13",
27
- "esbuild": "0.23.1",
28
- "eslint": "^9.12.0",
27
+ "esbuild": "0.24.0",
28
+ "eslint": "^9.13.0",
29
29
  "eslint-config-prettier": "^9.1.0",
30
- "eslint-plugin-svelte": "^2.45.1",
30
+ "eslint-plugin-svelte": "^2.46.0",
31
31
  "flowbite-svelte-icons": "^1.6.2",
32
32
  "globals": "^15.11.0",
33
33
  "mdsvex": "^0.12.3",
@@ -36,7 +36,7 @@
36
36
  "prettier": "^3.3.3",
37
37
  "prettier-plugin-svelte": "^3.2.7",
38
38
  "prism-themes": "^1.9.0",
39
- "publint": "^0.2.11",
39
+ "publint": "^0.2.12",
40
40
  "svelte": "^4.2.19",
41
41
  "svelte-check": "^4.0.5",
42
42
  "svelte-lib-helpers": "^0.4.16",
@@ -47,9 +47,9 @@
47
47
  "tailwindcss": "^3.4.14",
48
48
  "tslib": "^2.8.0",
49
49
  "typescript": "^5.6.3",
50
- "typescript-eslint": "8.4.0",
51
- "vite": "^5.4.9",
52
- "vitest": "^1.6.0"
50
+ "typescript-eslint": "8.11.0",
51
+ "vite": "^5.4.10",
52
+ "vitest": "^2.1.4"
53
53
  },
54
54
  "peerDependencies": {
55
55
  "svelte": "^3.55.1 || ^4.0.0 || ^5.0.0"