flowbite-svelte 1.2.6 → 1.2.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.
@@ -8,11 +8,13 @@
8
8
  const group: SizeType = getContext("group");
9
9
  const ctxDisabled: boolean | undefined = getContext("disabled");
10
10
 
11
- let { children, onclick, pill, outline = false, size = group ? "sm" : "md", color = group ? (outline ? "dark" : "alternative") : "primary", shadow = false, tag = "button", disabled, class: className, ...restProps }: ButtonProps = $props();
11
+ let { children, onclick, pill, outline = false, size = "md", color = "primary", shadow = false, tag = "button", disabled, class: className, ...restProps }: ButtonProps = $props();
12
12
 
13
+ let actualSize = $derived(group ? "sm" : size);
14
+ let actualColor = $derived(group ? (outline ? "dark" : "alternative") : color);
13
15
  let isDisabled = $derived(Boolean(ctxDisabled) || Boolean(disabled));
14
16
 
15
- const { base, outline: outline_, shadow: shadow_ } = $derived(button({ color, size, disabled: isDisabled, pill, group: !!group }));
17
+ const { base, outline: outline_, shadow: shadow_ } = $derived(button({ color: actualColor, size: actualSize, disabled: isDisabled, pill, group: !!group }));
16
18
  let btnCls = $derived(twMerge(base(), outline && outline_(), shadow && shadow_(), clsx(className)));
17
19
  </script>
18
20
 
@@ -40,8 +42,8 @@
40
42
  @prop onclick
41
43
  @prop pill
42
44
  @prop outline = false
43
- @prop size = group ? "sm" : "md"
44
- @prop color = group ? (outline ? "dark" : "alternative") : "primary"
45
+ @prop size = "md"
46
+ @prop color = "primary"
45
47
  @prop shadow = false
46
48
  @prop tag = "button"
47
49
  @prop disabled
@@ -8,8 +8,8 @@ import type { ButtonProps } from "..";
8
8
  * @prop onclick
9
9
  * @prop pill
10
10
  * @prop outline = false
11
- * @prop size = group ? "sm" : "md"
12
- * @prop color = group ? (outline ? "dark" : "alternative") : "primary"
11
+ * @prop size = "md"
12
+ * @prop color = "primary"
13
13
  * @prop shadow = false
14
14
  * @prop tag = "button"
15
15
  * @prop disabled
@@ -6,16 +6,7 @@
6
6
 
7
7
  type HTMLInputElementWithFiles = HTMLInputElement & { files: FileList | null };
8
8
 
9
- let {
10
- children,
11
- files = $bindable<FileList | null>(),
12
- class: className,
13
- ...restProps
14
- }: DropzoneProps & {
15
- ondrop?: DragEventHandler<HTMLButtonElement>;
16
- ondragover?: DragEventHandler<HTMLButtonElement>;
17
- onchange?: ChangeEventHandler<HTMLInputElementWithFiles>;
18
- } = $props();
9
+ let { children, files = $bindable<FileList | null>(), class: className, ...restProps }: DropzoneProps = $props();
19
10
 
20
11
  const base = $derived(dropzone({ class: clsx(className) }));
21
12
  let input: HTMLInputElement;
@@ -66,3 +57,15 @@
66
57
  <label class="hidden">
67
58
  <input {...restProps} bind:files bind:this={input} onchange={onChange} type="file" />
68
59
  </label>
60
+
61
+ <!--
62
+ @component
63
+ [Go to docs](https://flowbite-svelte.com/)
64
+ ## Type
65
+ [DropzoneProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L691)
66
+ ## Props
67
+ @prop children
68
+ @prop files = $bindable<FileList | null>()
69
+ @prop class: className
70
+ @prop ...restProps
71
+ -->
@@ -1,13 +1,14 @@
1
- import type { DragEventHandler, ChangeEventHandler } from "svelte/elements";
2
1
  import type { DropzoneProps } from "../../types";
3
- type HTMLInputElementWithFiles = HTMLInputElement & {
4
- files: FileList | null;
5
- };
6
- type $$ComponentProps = DropzoneProps & {
7
- ondrop?: DragEventHandler<HTMLButtonElement>;
8
- ondragover?: DragEventHandler<HTMLButtonElement>;
9
- onchange?: ChangeEventHandler<HTMLInputElementWithFiles>;
10
- };
11
- declare const Dropzone: import("svelte").Component<$$ComponentProps, {}, "files">;
2
+ /**
3
+ * [Go to docs](https://flowbite-svelte.com/)
4
+ * ## Type
5
+ * [DropzoneProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L691)
6
+ * ## Props
7
+ * @prop children
8
+ * @prop files = $bindable<FileList | null>()
9
+ * @prop class: className
10
+ * @prop ...restProps
11
+ */
12
+ declare const Dropzone: import("svelte").Component<DropzoneProps, {}, "files">;
12
13
  type Dropzone = ReturnType<typeof Dropzone>;
13
14
  export default Dropzone;
@@ -23,8 +23,8 @@
23
23
  {/if}
24
24
 
25
25
  {#if items}
26
- {#each items as { value, name }}
27
- <option {value}>{name}</option>
26
+ {#each items as item}
27
+ <option value={item.value} disabled={item.disabled}>{item.name}</option>
28
28
  {/each}
29
29
  {/if}
30
30
 
package/dist/index.d.ts CHANGED
@@ -32,7 +32,7 @@ export * from "./sidebar";
32
32
  export * from "./skeleton";
33
33
  export * from "./speed-dial";
34
34
  export * from "./spinner";
35
- export * from "./steps";
35
+ export * from "./stepindicator";
36
36
  export * from "./tabs";
37
37
  export * from "./table";
38
38
  export * from "./timeline";
package/dist/index.js CHANGED
@@ -32,7 +32,7 @@ export * from "./sidebar";
32
32
  export * from "./skeleton";
33
33
  export * from "./speed-dial";
34
34
  export * from "./spinner";
35
- export * from "./steps";
35
+ export * from "./stepindicator";
36
36
  export * from "./tabs";
37
37
  export * from "./table";
38
38
  export * from "./timeline";
package/dist/types.d.ts CHANGED
@@ -3,7 +3,7 @@ import type { TransitionConfig, FadeParams, BlurParams, FlyParams, SlideParams,
3
3
  import { type Writable } from "svelte/store";
4
4
  import type { Snippet, Component } from "svelte";
5
5
  import { tv, type VariantProps } from "tailwind-variants";
6
- import type { Middleware, Placement, Strategy } from "@floating-ui/dom";
6
+ import type { Coords, Middleware, Placement, Strategy } from "@floating-ui/dom";
7
7
  import type { AlertVariants } from "./alert/theme";
8
8
  import type { BadgeVariants } from "./badge/theme";
9
9
  import type { BannerVariants } from "./banner/theme";
@@ -1575,4 +1575,10 @@ export interface PopperProps extends Omit<HTMLAttributes<HTMLDivElement>, "onbef
1575
1575
  transitionParams?: ParamsType;
1576
1576
  isOpen?: boolean | undefined;
1577
1577
  }
1578
+ export interface ArrowProps {
1579
+ placement?: Placement;
1580
+ cords: Partial<Coords>;
1581
+ strategy?: "absolute" | "fixed";
1582
+ class?: string;
1583
+ }
1578
1584
  export {};
@@ -1,18 +1,9 @@
1
1
  <script lang="ts">
2
- import type { Coords, Placement, Side } from "@floating-ui/dom";
2
+ import type { Side } from "@floating-ui/dom";
3
3
  import { getOppositePlacement, getSide } from "@floating-ui/utils";
4
+ import { type ArrowProps } from "..";
4
5
 
5
- let {
6
- placement = "top",
7
- cords,
8
- strategy = "absolute",
9
- class: className = ""
10
- }: {
11
- placement?: Placement;
12
- cords: Partial<Coords>;
13
- strategy?: "absolute" | "fixed";
14
- class?: string;
15
- } = $props();
6
+ let { placement = "top", cords, strategy = "absolute", class: className = "" }: ArrowProps = $props();
16
7
 
17
8
  const px = (n: number | undefined) => (n ? `${n}px` : "");
18
9
 
@@ -58,8 +49,13 @@
58
49
  <!--
59
50
  @component
60
51
  [Go to docs](https://flowbite-svelte.com/)
52
+ ## Type
53
+ [ArrowProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1861)
61
54
  ## Props
62
- @props:
55
+ @prop placement = "top"
56
+ @prop cords
57
+ @prop strategy = "absolute"
58
+ @prop class: className = ""
63
59
  -->
64
60
 
65
61
  <style>
@@ -1,15 +1,14 @@
1
- import type { Coords, Placement } from "@floating-ui/dom";
2
- type $$ComponentProps = {
3
- placement?: Placement;
4
- cords: Partial<Coords>;
5
- strategy?: "absolute" | "fixed";
6
- class?: string;
7
- };
1
+ import { type ArrowProps } from "..";
8
2
  /**
9
3
  * [Go to docs](https://flowbite-svelte.com/)
4
+ * ## Type
5
+ * [ArrowProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1861)
10
6
  * ## Props
11
- * @props:
7
+ * @prop placement = "top"
8
+ * @prop cords
9
+ * @prop strategy = "absolute"
10
+ * @prop class: className = ""
12
11
  */
13
- declare const Arrow: import("svelte").Component<$$ComponentProps, {}, "">;
12
+ declare const Arrow: import("svelte").Component<ArrowProps, {}, "">;
14
13
  type Arrow = ReturnType<typeof Arrow>;
15
14
  export default Arrow;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flowbite-svelte",
3
- "version": "1.2.6",
3
+ "version": "1.2.7",
4
4
  "description": "Flowbite components for Svelte",
5
5
  "main": "dist/index.js",
6
6
  "author": {
@@ -16,7 +16,7 @@
16
16
  "@docsearch/css": "^3.9.0",
17
17
  "@docsearch/js": "^3.9.0",
18
18
  "@eslint/compat": "^1.2.9",
19
- "@eslint/js": "^9.26.0",
19
+ "@eslint/js": "^9.27.0",
20
20
  "@playwright/test": "^1.52.0",
21
21
  "@sveltejs/adapter-auto": "^6.0.1",
22
22
  "@sveltejs/adapter-vercel": "^5.7.2",
@@ -24,31 +24,32 @@
24
24
  "@sveltejs/package": "2.3.11",
25
25
  "@sveltejs/vite-plugin-svelte": "^5.0.3",
26
26
  "@svitejs/changesets-changelog-github-compact": "^1.2.0",
27
- "@tailwindcss/vite": "^4.1.6",
27
+ "@tailwindcss/vite": "^4.1.7",
28
28
  "@testing-library/jest-dom": "^6.6.3",
29
29
  "@testing-library/svelte": "^5.2.7",
30
30
  "clsx": "^2.1.1",
31
31
  "dayjs": "^1.11.13",
32
32
  "deepmerge": "^4.3.1",
33
- "eslint": "^9.26.0",
33
+ "eslint": "^9.27.0",
34
34
  "eslint-config-prettier": "^10.1.5",
35
- "eslint-plugin-svelte": "^3.6.0",
35
+ "eslint-plugin-svelte": "^3.8.1",
36
36
  "flowbite-svelte-icons": "^2.1.1",
37
37
  "globals": "^16.1.0",
38
38
  "jsdom": "^26.1.0",
39
39
  "mdsvex": "^0.12.6",
40
40
  "mdsvexamples": "^0.5.0",
41
41
  "prettier": "^3.5.3",
42
- "prettier-plugin-svelte": "^3.3.3",
42
+ "prettier-plugin-svelte": "^3.4.0",
43
43
  "prettier-plugin-tailwindcss": "^0.6.11",
44
44
  "prism-themes": "^1.9.0",
45
45
  "publint": "^0.3.12",
46
- "svelte": "^5.28.6",
47
- "svelte-check": "^4.1.7",
48
- "svelte-lib-helpers": "^0.4.28",
46
+ "svelte": "^5.30.2",
47
+ "svelte-check": "^4.2.1",
48
+ "svelte-doc-llm": "^0.2.1",
49
+ "svelte-lib-helpers": "^0.4.30",
49
50
  "svelte-meta-tags": "^4.3.0",
50
51
  "svelte-rune-highlight": "^0.6.6",
51
- "tailwindcss": "^4.1.6",
52
+ "tailwindcss": "^4.1.7",
52
53
  "tsx": "^4.19.4",
53
54
  "typescript": "^5.8.3",
54
55
  "typescript-eslint": "8.31.1",
@@ -109,7 +110,7 @@
109
110
  "flowbite": "^3.1.2",
110
111
  "tailwind-merge": "^3.3.0",
111
112
  "tailwind-variants": "^1.0.0",
112
- "virtua": "^0.41.0"
113
+ "virtua": "^0.41.2"
113
114
  },
114
115
  "files": [
115
116
  "dist",
@@ -580,8 +581,8 @@
580
581
  "svelte": "./dist/spinner/Spinner.svelte"
581
582
  },
582
583
  "./StepIndicator.svelte": {
583
- "types": "./dist/steps/StepIndicator.svelte.d.ts",
584
- "svelte": "./dist/steps/StepIndicator.svelte"
584
+ "types": "./dist/stepindicator/StepIndicator.svelte.d.ts",
585
+ "svelte": "./dist/stepindicator/StepIndicator.svelte"
585
586
  },
586
587
  "./Table.svelte": {
587
588
  "types": "./dist/table/Table.svelte.d.ts",
@@ -758,6 +759,7 @@
758
759
  "gen:component-data-prop-value": "svelte-lib-helpers component-data-prop-value themesberg/flowbite-svelte",
759
760
  "copy:packagejson": "svelte-lib-helpers package",
760
761
  "lib-helpers": "pnpm gen:component-data-prop-value && pnpm gen:docspropvalue && pnpm format && pnpm package && pnpm gen:exports && pnpm copy:packagejson",
762
+ "llm": "svelte-doc-llm",
761
763
  "ch": "npx changeset",
762
764
  "cv": "npx changeset version",
763
765
  "cp": "npx changeset publish"
File without changes
File without changes