flowbite-svelte 1.31.0 → 1.32.0

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.
@@ -13,6 +13,7 @@
13
13
  header,
14
14
  arrowup,
15
15
  arrowdown,
16
+ headingTag,
16
17
  open = $bindable(false),
17
18
  activeClass,
18
19
  inactiveClass,
@@ -70,7 +71,7 @@
70
71
  let buttonClass = $derived(clsx(open && !ctx?.flush && (styling.active || ctx?.activeClass || active()), !open && !ctx?.flush && (styling.inactive || ctx?.inactiveClass || inactive())));
71
72
  </script>
72
73
 
73
- <h2 class={base({ class: clsx(theme?.base, className) })}>
74
+ <svelte:element this={headingTag ?? "h2"} class={base({ class: clsx(theme?.base, className) })}>
74
75
  <button type="button" onclick={handleToggle} class={button({ class: clsx(buttonClass, theme?.button, styling.button) })} aria-expanded={open}>
75
76
  {#if header}
76
77
  {@render header()}
@@ -91,7 +92,7 @@
91
92
  {/if}
92
93
  {/if}
93
94
  </button>
94
- </h2>
95
+ </svelte:element>
95
96
 
96
97
  {#if useTransition}
97
98
  {#if open && transitionType !== "none"}
@@ -55,13 +55,6 @@
55
55
  isOpen = inline;
56
56
  });
57
57
  let showMonthSelector: boolean = $state(false);
58
- let inputElement: HTMLInputElement | null = $state(null);
59
-
60
- $effect(() => {
61
- if (inputElement) {
62
- elementRef = inputElement;
63
- }
64
- });
65
58
  let datepickerContainerElement: HTMLDivElement;
66
59
  let currentMonth: Date = $state(new Date());
67
60
  $effect(() => {
@@ -162,15 +155,15 @@
162
155
  }
163
156
 
164
157
  function handleInputChangeWithDateFns() {
165
- const inputValue = inputElement?.value?.trim();
158
+ const inputValue = elementRef?.value?.trim();
166
159
  if (!inputValue) {
167
160
  rangeFrom = undefined;
168
161
  rangeTo = undefined;
169
- inputElement?.setCustomValidity("");
162
+ elementRef?.setCustomValidity("");
170
163
  return;
171
164
  }
172
165
 
173
- inputElement?.setCustomValidity("");
166
+ elementRef?.setCustomValidity("");
174
167
 
175
168
  if (range) {
176
169
  const parts = inputValue.split(" - ");
@@ -183,7 +176,7 @@
183
176
  onselect?.({ from: rangeFrom, to: rangeTo });
184
177
  return;
185
178
  } else {
186
- inputElement?.setCustomValidity(`Please enter date range in format: ${getDateFormatPattern()} - ${getDateFormatPattern()}`);
179
+ elementRef?.setCustomValidity(`Please enter date range in format: ${getDateFormatPattern()} - ${getDateFormatPattern()}`);
187
180
  return;
188
181
  }
189
182
  }
@@ -193,12 +186,12 @@
193
186
 
194
187
  if (!parsedDate || !isValid(parsedDate)) {
195
188
  const formatPattern = getDateFormatPattern();
196
- inputElement?.setCustomValidity(`Please enter date in format: ${formatPattern}`);
189
+ elementRef?.setCustomValidity(`Please enter date in format: ${formatPattern}`);
197
190
  return;
198
191
  }
199
192
 
200
193
  if (!isDateAvailable(parsedDate)) {
201
- inputElement?.setCustomValidity("Selected date is not available");
194
+ elementRef?.setCustomValidity("Selected date is not available");
202
195
  return;
203
196
  }
204
197
 
@@ -353,7 +346,7 @@
353
346
  case "Escape":
354
347
  isOpen = false;
355
348
  showMonthSelector = false;
356
- inputElement?.focus();
349
+ elementRef?.focus();
357
350
  break;
358
351
  default:
359
352
  return;
@@ -421,7 +414,7 @@
421
414
  <div class="relative">
422
415
  <input
423
416
  {...inputProps}
424
- bind:this={inputElement}
417
+ bind:this={elementRef}
425
418
  type="text"
426
419
  class={input({ color, class: clsx(theme?.input, inputClass) })}
427
420
  {placeholder}
@@ -24,6 +24,7 @@
24
24
  class: className,
25
25
  classes,
26
26
  // Extract select-specific props
27
+ id,
27
28
  name,
28
29
  form,
29
30
  required,
@@ -124,6 +125,7 @@
124
125
  // This is useful if the click triggers a re-render and focus is lost momentarily.
125
126
  if (multiSelectContainer && multiSelectContainer.contains(event.target as Node)) {
126
127
  show = !show;
128
+ event.preventDefault();
127
129
  } else {
128
130
  show = false; // Close if clicked outside
129
131
  }
@@ -204,12 +206,6 @@
204
206
  const { base, dropdown, item: dropdownItem, close, select, placeholder: placeholderSpan, svg } = $derived(multiSelect({ disabled, grouped: !!group }));
205
207
  </script>
206
208
 
207
- <select {name} {form} {required} {autocomplete} {value} hidden multiple {onchange}>
208
- {#each items as item (item.value)}
209
- <option value={item.value} disabled={item.disabled}>{item.name}</option>
210
- {/each}
211
- </select>
212
-
213
209
  <div
214
210
  bind:this={multiSelectContainer}
215
211
  {...restProps}
@@ -220,6 +216,12 @@
220
216
  role="listbox"
221
217
  class={base({ size, class: clsx(theme?.base, className) })}
222
218
  >
219
+ <select {id} {name} {form} {required} {autocomplete} {value} hidden multiple {onchange}>
220
+ {#each items as item (item.value)}
221
+ <option value={item.value} disabled={item.disabled}>{item.name}</option>
222
+ {/each}
223
+ </select>
224
+
223
225
  {#if !selectItems.length}
224
226
  <span class={placeholderSpan({ class: clsx(classes?.placeholder) })}>{placeholder}</span>
225
227
  {/if}
@@ -182,7 +182,7 @@
182
182
  <CloseButton {disabled} size={closeBtnSize} class={close({ class: clsx(theme?.close, styling.close) })} onclick={() => deleteField(index)} />
183
183
  </div>
184
184
  {/each}
185
- <div class="relative w-full" bind:this={inputContainer}>
185
+ <div class="relative min-w-[8rem] flex-1 self-center" bind:this={inputContainer}>
186
186
  <input
187
187
  {...inputProps}
188
188
  {disabled}
@@ -1,11 +1,11 @@
1
1
  import { tv } from "tailwind-variants";
2
2
  export const tags = tv({
3
3
  slots: {
4
- base: "border border-gray-300 dark:border-gray-600 rounded-lg flex focus-within:ring-primary-500 focus-within:ring-1 focus-within:border-primary-500 scrollbar-hidden bg-gray-50 dark:bg-gray-700",
5
- tag: "flex items-center rounded-lg bg-gray-100 text-gray-900 border border-gray-300 my-1 ml-1 px-2 text-sm max-w-full min-w-fit",
4
+ base: "border border-gray-300 dark:border-gray-600 rounded-lg flex flex-wrap focus-within:ring-primary-500 focus-within:ring-1 focus-within:border-primary-500 scrollbar-hidden bg-gray-50 dark:bg-gray-700 p-2",
5
+ tag: "flex items-center rounded-lg bg-gray-100 text-gray-900 border border-gray-300 my-1 ml-1 p-2 text-sm max-w-full min-w-fit",
6
6
  span: "items-center",
7
7
  close: "my-auto ml-1",
8
- input: "block text-sm m-2.5 p-0 bg-transparent border-none outline-none text-gray-900 h-min w-full min-w-fit focus:ring-0 placeholder-gray-400 dark:text-white disabled:cursor-not-allowed disabled:opacity-50",
8
+ input: "block text-sm my-1 mx-2.5 p-0 bg-transparent border-none outline-none text-gray-900 w-full min-w-fit focus:ring-0 placeholder-gray-400 dark:text-white disabled:cursor-not-allowed disabled:opacity-50",
9
9
  info: "mt-1 text-sm text-blue-500 dark:text-blue-400",
10
10
  warning: "mt-1 text-sm text-yellow-400 dark:text-yellow-300",
11
11
  error: "mt-1 text-sm text-red-500 dark:text-red-400"
package/dist/types.d.ts CHANGED
@@ -155,6 +155,7 @@ export interface AccordionItemProps extends AccordionItemVariants, HTMLAttribute
155
155
  header?: Snippet;
156
156
  arrowup?: Snippet;
157
157
  arrowdown?: Snippet;
158
+ headingTag?: "h2" | "h3" | "h4" | "h5" | "h6" | "div";
158
159
  activeClass?: string;
159
160
  inactiveClass?: string;
160
161
  transitionType?: TransitionFunc | "none";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flowbite-svelte",
3
- "version": "1.31.0",
3
+ "version": "1.32.0",
4
4
  "description": "Flowbite components for Svelte",
5
5
  "main": "dist/index.js",
6
6
  "author": {
@@ -12,70 +12,70 @@
12
12
  "homepage": "https://flowbite-svelte.com/",
13
13
  "license": "MIT",
14
14
  "devDependencies": {
15
- "@changesets/cli": "^2.29.8",
16
- "@docsearch/css": "^4.3.2",
17
- "@docsearch/js": "^4.3.2",
18
- "@eslint/compat": "^2.0.0",
19
- "@eslint/js": "^9.39.2",
15
+ "@changesets/cli": "^2.30.0",
16
+ "@docsearch/css": "^4.6.2",
17
+ "@docsearch/js": "^4.6.2",
18
+ "@eslint/compat": "^2.0.3",
19
+ "@eslint/js": "^10.0.1",
20
20
  "@flowbite-svelte-plugins/chart": "^0.2.4",
21
21
  "@flowbite-svelte-plugins/datatable": "^0.4.1",
22
22
  "@flowbite-svelte-plugins/texteditor": "^0.25.6",
23
- "@playwright/test": "^1.57.0",
23
+ "@playwright/test": "^1.58.2",
24
24
  "@resvg/resvg-js": "^2.6.2",
25
- "@sveltejs/adapter-vercel": "^6.2.0",
26
- "@sveltejs/kit": "^2.49.2",
25
+ "@sveltejs/adapter-vercel": "^6.3.3",
26
+ "@sveltejs/kit": "^2.55.0",
27
27
  "@sveltejs/package": "^2.5.7",
28
- "@sveltejs/vite-plugin-svelte": "^6.2.1",
28
+ "@sveltejs/vite-plugin-svelte": "^6.2.4",
29
29
  "@svitejs/changesets-changelog-github-compact": "^1.2.0",
30
- "@tailwindcss/vite": "^4.1.18",
30
+ "@tailwindcss/vite": "^4.2.2",
31
31
  "@testing-library/jest-dom": "^6.9.1",
32
- "@testing-library/svelte": "^5.2.9",
32
+ "@testing-library/svelte": "^5.3.1",
33
33
  "@testing-library/user-event": "^14.6.1",
34
34
  "@tiptap/core": "3.7.2",
35
- "@vitest/browser": "^4.0.16",
36
- "@vitest/browser-playwright": "^4.0.16",
37
- "dayjs": "^1.11.19",
35
+ "@vitest/browser": "^4.1.1",
36
+ "@vitest/browser-playwright": "^4.1.1",
37
+ "dayjs": "^1.11.20",
38
38
  "deepmerge": "^4.3.1",
39
- "eslint": "^9.39.2",
39
+ "eslint": "^10.1.0",
40
40
  "eslint-config-prettier": "^10.1.8",
41
- "eslint-plugin-svelte": "^3.13.1",
41
+ "eslint-plugin-svelte": "^3.16.0",
42
42
  "flowbite-svelte-admin-dashboard": "^2.1.1",
43
43
  "flowbite-svelte-blocks": "^2.1.0",
44
- "flowbite-svelte-icons": "^3.0.1",
44
+ "flowbite-svelte-icons": "^3.1.0",
45
45
  "flowbite-svelte-illustrations": "^1.0.6",
46
46
  "flowbite-typography": "^1.0.5",
47
47
  "globals": "^16.5.0",
48
48
  "highlight.js": "^11.11.1",
49
- "jsdom": "^27.3.0",
50
- "katex": "^0.16.27",
49
+ "jsdom": "^27.4.0",
50
+ "katex": "^0.16.43",
51
51
  "lowlight": "^3.3.0",
52
- "mdsvex": "^0.12.6",
53
- "mdsvexamples": "^0.5.0",
54
- "playwright": "^1.57.0",
55
- "prettier": "^3.7.4",
56
- "prettier-plugin-svelte": "^3.4.1",
52
+ "mdsvex": "^0.12.7",
53
+ "mdsvexamples": "^0.5.1",
54
+ "playwright": "^1.58.2",
55
+ "prettier": "^3.8.1",
56
+ "prettier-plugin-svelte": "^3.5.1",
57
57
  "prettier-plugin-tailwindcss": "^0.7.2",
58
58
  "prism-themes": "^1.9.0",
59
- "publint": "^0.3.16",
59
+ "publint": "^0.3.18",
60
60
  "runatics": "^0.2.0",
61
61
  "runes-meta-tags": "^0.5.0",
62
- "satori": "^0.18.3",
62
+ "satori": "^0.26.0",
63
63
  "satori-html": "^0.3.2",
64
- "super-sitemap": "^1.0.5",
65
- "svelte": "^5.46.0",
66
- "svelte-check": "^4.3.4",
64
+ "super-sitemap": "^1.0.7",
65
+ "svelte": "^5.55.0",
66
+ "svelte-check": "^4.4.5",
67
67
  "svelte-doc-llm": "^0.8.0",
68
68
  "svelte-lib-helpers": "^0.4.31",
69
- "svelte-meta-tags": "^4.5.0",
69
+ "svelte-meta-tags": "^4.5.1",
70
70
  "svelte-rune-highlight": "^0.12.1",
71
- "tailwindcss": "^4.1.18",
71
+ "tailwindcss": "^4.2.2",
72
72
  "tsx": "^4.21.0",
73
73
  "typescript": "^5.9.3",
74
- "typescript-eslint": "^8.50.0",
75
- "vite": "^7.3.0",
74
+ "typescript-eslint": "^8.57.2",
75
+ "vite": "^7.3.1",
76
76
  "vite-plugin-devtools-json": "^1.0.0",
77
- "vitest": "^4.0.16",
78
- "vitest-browser-svelte": "^2.0.1"
77
+ "vitest": "^4.1.1",
78
+ "vitest-browser-svelte": "^2.1.0"
79
79
  },
80
80
  "peerDependencies": {
81
81
  "svelte": "^5.40.0",
@@ -125,14 +125,14 @@
125
125
  "url": "git+https://github.com/themesberg/flowbite-svelte.git"
126
126
  },
127
127
  "dependencies": {
128
- "@floating-ui/dom": "^1.7.4",
129
- "@floating-ui/utils": "^0.2.10",
130
- "apexcharts": "^5.3.6",
128
+ "@floating-ui/dom": "^1.7.6",
129
+ "@floating-ui/utils": "^0.2.11",
130
+ "apexcharts": "^5.10.4",
131
131
  "clsx": "^2.1.1",
132
132
  "date-fns": "^4.1.0",
133
133
  "esm-env": "^1.2.2",
134
134
  "flowbite": "^3.1.2",
135
- "tailwind-merge": "^3.4.0",
135
+ "tailwind-merge": "^3.5.0",
136
136
  "tailwind-variants": "^3.2.2"
137
137
  },
138
138
  "files": [
File without changes