flowbite-svelte 0.46.9 → 0.46.11

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,21 +1,25 @@
1
1
  <script>import { getContext } from "svelte";
2
2
  import { labelClass, inputClass } from "./Radio.svelte";
3
3
  import Label from "./Label.svelte";
4
- export let name;
4
+ export let name = void 0;
5
5
  export let color = "primary";
6
6
  export let custom = false;
7
7
  export let inline = false;
8
- export let group;
9
- export let choices;
8
+ export let group = [];
9
+ export let choices = [];
10
10
  export let value = "on";
11
11
  export let checked = void 0;
12
12
  export let spacing = $$slots.default ? "me-2" : "";
13
+ export let groupLabelClass = "";
14
+ export let groupInputClass = "";
13
15
  let background = getContext("background");
14
16
  </script>
15
- {#if group}
16
- {#each choices as checkbox}
17
- <label for={`checkbox-${value}`}>{ checkbox.label }</label>
18
- <input type="checkbox" value={ checkbox.value } bind:group>
17
+ {#if choices.length > 0}
18
+ {#each choices as {value, label}, i}
19
+ <Label class={labelClass(inline, groupLabelClass)} show={$$slots.default} for={`checkbox-${i}`}>{ label }
20
+ <input {name} id={`checkbox-${i}`} type="checkbox" value={ value } bind:group {...$$restProps} class={inputClass(custom, color, true, background, spacing, groupInputClass)} />
21
+ <slot />
22
+ </Label>
19
23
  {/each}
20
24
  {:else}
21
25
  <Label class={labelClass(inline, $$props.class)} show={$$slots.default}>
@@ -28,13 +32,15 @@ let background = getContext("background");
28
32
  @component
29
33
  [Go to docs](https://flowbite-svelte.com/)
30
34
  ## Props
31
- @prop export let name: string;
35
+ @prop export let name: string | undefined = undefined;
32
36
  @prop export let color: FormColorType = 'primary';
33
37
  @prop export let custom: boolean = false;
34
38
  @prop export let inline: boolean = false;
35
- @prop export let group: CheckboxItem[];
36
- @prop export let choices: CheckboxItem[];
39
+ @prop export let group: string[] = [];
40
+ @prop export let choices: CheckboxItem[] = [];
37
41
  @prop export let value: string | number = 'on';
38
42
  @prop export let checked: boolean | undefined = undefined;
39
43
  @prop export let spacing: string = $$slots.default ? 'me-2' : '';
44
+ @prop export let groupLabelClass: string = '';
45
+ @prop export let groupInputClass: strixng = '';
40
46
  -->
@@ -1,25 +1,20 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
2
  import type { FormColorType } from '../types';
3
+ import type { CheckboxItem } from '../types';
3
4
  declare const __propDef: {
4
5
  props: {
5
6
  [x: string]: any;
6
- name: string;
7
+ name?: string | undefined;
7
8
  color?: FormColorType;
8
9
  custom?: boolean;
9
10
  inline?: boolean;
10
- group: {
11
- value: string;
12
- label: string;
13
- isChecked?: boolean;
14
- }[];
15
- choices: {
16
- value: string;
17
- label: string;
18
- isChecked?: boolean;
19
- }[];
11
+ group?: string[];
12
+ choices?: CheckboxItem[];
20
13
  value?: string | number;
21
14
  checked?: boolean | undefined;
22
15
  spacing?: string;
16
+ groupLabelClass?: string;
17
+ groupInputClass?: any;
23
18
  };
24
19
  events: {
25
20
  keyup: KeyboardEvent;
@@ -46,15 +41,17 @@ export type CheckboxSlots = typeof __propDef.slots;
46
41
  /**
47
42
  * [Go to docs](https://flowbite-svelte.com/)
48
43
  * ## Props
49
- * @prop export let name: string;
44
+ * @prop export let name: string | undefined = undefined;
50
45
  * @prop export let color: FormColorType = 'primary';
51
46
  * @prop export let custom: boolean = false;
52
47
  * @prop export let inline: boolean = false;
53
- * @prop export let group: CheckboxItem[];
54
- * @prop export let choices: CheckboxItem[];
48
+ * @prop export let group: string[] = [];
49
+ * @prop export let choices: CheckboxItem[] = [];
55
50
  * @prop export let value: string | number = 'on';
56
51
  * @prop export let checked: boolean | undefined = undefined;
57
52
  * @prop export let spacing: string = $$slots.default ? 'me-2' : '';
53
+ * @prop export let groupLabelClass: string = '';
54
+ * @prop export let groupInputClass: strixng = '';
58
55
  */
59
56
  export default class Checkbox extends SvelteComponentTyped<CheckboxProps, CheckboxEvents, CheckboxSlots> {
60
57
  }
@@ -1,7 +1,6 @@
1
- <script>import TransitionFrame from "../utils/TransitionFrame.svelte";
1
+ <script>import { fade } from "svelte/transition";
2
2
  import { twMerge } from "tailwind-merge";
3
- import CloseButton from "../utils/CloseButton.svelte";
4
- import Frame from "../utils/Frame.svelte";
3
+ import { CloseButton } from "..";
5
4
  export let dismissable = true;
6
5
  export let color = "primary";
7
6
  export let position = "none";
@@ -9,6 +8,9 @@ export let divClass = "w-full max-w-xs p-4 text-gray-500 bg-white shadow dark:te
9
8
  export let defaultIconClass = "w-8 h-8";
10
9
  export let contentClass = "w-full text-sm font-normal";
11
10
  export let align = true;
11
+ export let transition = fade;
12
+ export let params = {};
13
+ export let toastStatus = true;
12
14
  const positions = {
13
15
  "top-left": "absolute top-5 start-5",
14
16
  "top-right": "absolute top-5 end-5",
@@ -16,8 +18,13 @@ const positions = {
16
18
  "bottom-right": "absolute bottom-5 end-5",
17
19
  none: ""
18
20
  };
19
- let finalDivClass;
20
- $: finalDivClass = twMerge("flex", align ? "items-center" : "items-start", divClass, positions[position], $$props.class);
21
+ let finalDivClass = twMerge(
22
+ "flex",
23
+ align ? "items-center" : "items-start",
24
+ divClass,
25
+ positions[position],
26
+ $$props.class
27
+ );
21
28
  const colors = {
22
29
  primary: "text-primary-500 bg-primary-100 dark:bg-primary-800 dark:text-primary-200",
23
30
  gray: "text-gray-500 bg-gray-100 dark:bg-gray-700 dark:text-gray-200",
@@ -27,41 +34,61 @@ const colors = {
27
34
  blue: "text-blue-500 bg-blue-100 dark:bg-blue-800 dark:text-blue-200",
28
35
  indigo: "text-indigo-500 bg-indigo-100 dark:bg-indigo-800 dark:text-indigo-200",
29
36
  purple: "text-purple-500 bg-purple-100 dark:bg-purple-800 dark:text-purple-200",
30
- orange: "text-orange-500 bg-orange-100 dark:bg-orange-700 dark:text-orange-200",
37
+ pink: "text-pink-500 bg-pink-100 dark:bg-pink-700 dark:text-pink-200",
31
38
  none: ""
32
39
  };
33
- let iconClass;
34
- $: iconClass = twMerge("inline-flex items-center justify-center shrink-0", colors[color], defaultIconClass);
35
- const clsBtnExtraClass = "-mx-1.5 -my-1.5 text-gray-400 hover:text-gray-900 focus:!ring-gray-300 hover:bg-gray-100 dark:text-gray-500 dark:hover:text-white dark:hover:bg-gray-700";
40
+ let iconClass = twMerge(
41
+ "inline-flex items-center justify-center shrink-0 rounded-lg",
42
+ colors[color],
43
+ defaultIconClass
44
+ );
45
+ const clsBtnExtraClass = "ms-auto -mx-1.5 -my-1.5 bg-white text-gray-400 hover:text-gray-900 rounded-lg focus:ring-2 focus:ring-gray-300 p-1.5 hover:bg-gray-100 inline-flex items-center justify-center h-8 w-8 dark:text-gray-500 dark:hover:text-white dark:bg-gray-800 dark:hover:bg-gray-700";
36
46
  </script>
37
47
 
38
- <TransitionFrame rounded color="none" role="alert" {...$$restProps} class={finalDivClass} let:close on:close>
39
- {#if $$slots.icon}
40
- <Frame rounded color="none" class={iconClass}>
41
- <slot name="icon" />
42
- </Frame>
43
- {/if}
48
+ {#if toastStatus}
49
+ <div
50
+ role="alert"
51
+ {...$$restProps}
52
+ class={finalDivClass}
53
+ transition:transition={params}
54
+ >
55
+ {#if $$slots.icon}
56
+ <div class={iconClass}>
57
+ <slot name="icon" />
58
+ </div>
59
+ {/if}
44
60
 
45
- <div class={contentClass}>
46
- <slot />
47
- </div>
61
+ <div class={contentClass}>
62
+ <slot />
63
+ </div>
48
64
 
49
- {#if dismissable}
50
- <slot name="close-button" {close}>
51
- <CloseButton class={clsBtnExtraClass} on:click={close} />
52
- </slot>
53
- {/if}
54
- </TransitionFrame>
65
+ {#if dismissable}
66
+ <CloseButton
67
+ divclass={clsBtnExtraClass}
68
+ ariaLabel="Remove toast"
69
+ {color}
70
+ on:click={() => {
71
+ toastStatus = false;
72
+ }}
73
+ />
74
+ {/if}
75
+ </div>
76
+ {/if}
55
77
 
56
78
  <!--
57
79
  @component
58
80
  [Go to docs](https://flowbite-svelte.com/)
59
81
  ## Props
60
82
  @prop export let dismissable: boolean = true;
61
- @prop export let color: 'primary' | 'gray' | 'red' | 'yellow' | 'green' | 'blue' | 'indigo' | 'purple' | 'orange' | 'none' = 'primary';
62
- @prop export let position: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'none' = 'none';
83
+ @prop export let color: ColorVariant = 'primary';
84
+ @prop export let position: ToastPositionType = 'none';
63
85
  @prop export let divClass: string = 'w-full max-w-xs p-4 text-gray-500 bg-white shadow dark:text-gray-400 dark:bg-gray-800 gap-3';
64
86
  @prop export let defaultIconClass: string = 'w-8 h-8';
65
87
  @prop export let contentClass: string = 'w-full text-sm font-normal';
88
+ @prop export let div2class: string = '';
89
+ @prop export let div3class: string = '';
66
90
  @prop export let align: boolean = true;
91
+ @prop export let transition: TransitionFunc = fade;
92
+ @prop export let params = {};
93
+ @prop export let toastStatus: boolean = true;
67
94
  -->
@@ -1,38 +1,26 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
+ import { type TransitionConfig } from 'svelte/transition';
3
+ import type { ColorVariant, ToastPositionType } from '../types';
2
4
  declare const __propDef: {
3
- props: import("svelte/elements").HTMLAnchorAttributes & {
4
- tag?: string;
5
- color?: "gray" | "red" | "yellow" | "green" | "indigo" | "purple" | "pink" | "blue" | "light" | "dark" | "default" | "dropdown" | "navbar" | "navbarUl" | "form" | "primary" | "orange" | "none";
6
- rounded?: boolean;
7
- border?: boolean;
8
- shadow?: boolean;
9
- node?: HTMLElement | undefined;
10
- use?: import("svelte/action").Action<HTMLElement, any>;
11
- options?: object;
12
- class?: string;
13
- role?: string;
14
- open?: boolean;
15
- transition?: (node: HTMLElement, params: any) => import("svelte/transition").TransitionConfig;
16
- params?: any;
17
- } & import("..").Dismissable & {
18
- color?: "primary" | "gray" | "red" | "yellow" | "green" | "blue" | "indigo" | "purple" | "orange" | "none";
19
- position?: "top-left" | "top-right" | "bottom-left" | "bottom-right" | "none";
5
+ props: {
6
+ [x: string]: any;
7
+ dismissable?: boolean;
8
+ color?: ColorVariant;
9
+ position?: ToastPositionType;
20
10
  divClass?: string;
21
11
  defaultIconClass?: string;
22
- extraIconClass?: string;
23
12
  contentClass?: string;
13
+ align?: boolean;
14
+ transition?: (node: HTMLElement, params: any) => TransitionConfig;
15
+ params?: {};
16
+ toastStatus?: boolean;
24
17
  };
25
18
  events: {
26
- close: CustomEvent<any>;
27
- } & {
28
19
  [evt: string]: CustomEvent<any>;
29
20
  };
30
21
  slots: {
31
22
  icon: {};
32
23
  default: {};
33
- 'close-button': {
34
- close: (ev: MouseEvent | undefined) => void;
35
- };
36
24
  };
37
25
  };
38
26
  export type ToastProps = typeof __propDef.props;
@@ -42,12 +30,17 @@ export type ToastSlots = typeof __propDef.slots;
42
30
  * [Go to docs](https://flowbite-svelte.com/)
43
31
  * ## Props
44
32
  * @prop export let dismissable: boolean = true;
45
- * @prop export let color: 'primary' | 'gray' | 'red' | 'yellow' | 'green' | 'blue' | 'indigo' | 'purple' | 'orange' | 'none' = 'primary';
46
- * @prop export let position: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'none' = 'none';
33
+ * @prop export let color: ColorVariant = 'primary';
34
+ * @prop export let position: ToastPositionType = 'none';
47
35
  * @prop export let divClass: string = 'w-full max-w-xs p-4 text-gray-500 bg-white shadow dark:text-gray-400 dark:bg-gray-800 gap-3';
48
36
  * @prop export let defaultIconClass: string = 'w-8 h-8';
49
37
  * @prop export let contentClass: string = 'w-full text-sm font-normal';
38
+ * @prop export let div2class: string = '';
39
+ * @prop export let div3class: string = '';
50
40
  * @prop export let align: boolean = true;
41
+ * @prop export let transition: TransitionFunc = fade;
42
+ * @prop export let params = {};
43
+ * @prop export let toastStatus: boolean = true;
51
44
  */
52
45
  export default class Toast extends SvelteComponentTyped<ToastProps, ToastEvents, ToastSlots> {
53
46
  }
package/dist/types.d.ts CHANGED
@@ -2,7 +2,12 @@ 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
3
  export type ButtonType = 'button' | 'submit' | 'reset';
4
4
  export type ButtonColorType = 'alternative' | 'blue' | 'dark' | 'green' | 'light' | 'primary' | 'purple' | 'red' | 'yellow' | 'none';
5
- export type ColorVariant = 'dark' | 'red' | 'yellow' | 'green' | 'indigo' | 'purple' | 'pink' | 'blue' | 'primary' | 'none';
5
+ export type CheckboxItem = {
6
+ value: string;
7
+ label?: string;
8
+ isChecked?: boolean;
9
+ };
10
+ export type ColorVariant = 'gray' | 'red' | 'yellow' | 'green' | 'indigo' | 'purple' | 'pink' | 'blue' | 'primary' | 'none';
6
11
  export type Colors = 'blue' | 'gray' | 'red' | 'yellow' | 'purple' | 'green' | 'indigo' | 'pink' | 'white' | 'custom' | 'primary' | 'secondary';
7
12
  export type ImgType = {
8
13
  src: string;
@@ -112,3 +117,4 @@ export interface ButtonClassesTypes {
112
117
  video?: string;
113
118
  custom?: string;
114
119
  }
120
+ export type ToastPositionType = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'none';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flowbite-svelte",
3
- "version": "0.46.9",
3
+ "version": "0.46.11",
4
4
  "description": "Flowbite components for Svelte",
5
5
  "main": "dist/index.js",
6
6
  "author": {
@@ -28,7 +28,7 @@
28
28
  "eslint": "^9.5.0",
29
29
  "eslint-config-prettier": "^9.1.0",
30
30
  "eslint-plugin-svelte": "^2.41.0",
31
- "flowbite-svelte": "^0.46.9",
31
+ "flowbite-svelte": "^0.46.11",
32
32
  "flowbite-svelte-blocks": "^1.1.3",
33
33
  "flowbite-svelte-icons": "^1.6.1",
34
34
  "mdsvex": "^0.11.2",
@@ -39,11 +39,11 @@
39
39
  "prism-themes": "^1.9.0",
40
40
  "publint": "^0.2.8",
41
41
  "svelte": "^4.2.18",
42
- "svelte-check": "^3.8.2",
42
+ "svelte-check": "^3.8.3",
43
43
  "svelte-lib-helpers": "^0.4.6",
44
44
  "svelte-meta-tags": "^3.1.2",
45
45
  "svelte-preprocess": "^6.0.1",
46
- "svelte2tsx": "^0.7.11",
46
+ "svelte2tsx": "^0.7.13",
47
47
  "tailwind-merge": "^1.13.1",
48
48
  "tailwindcss": "^3.4.4",
49
49
  "tslib": "^2.6.3",
@@ -100,7 +100,7 @@
100
100
  },
101
101
  "dependencies": {
102
102
  "@floating-ui/dom": "^1.6.6",
103
- "apexcharts": "^3.49.1",
103
+ "apexcharts": "^3.49.2",
104
104
  "flowbite": "^2.3.0",
105
105
  "tailwind-merge": "^2.3.0"
106
106
  },