flowbite-svelte 0.46.9 → 0.46.10

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
  }
package/dist/types.d.ts CHANGED
@@ -2,6 +2,11 @@ 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 CheckboxItem = {
6
+ value: string;
7
+ label?: string;
8
+ isChecked?: boolean;
9
+ };
5
10
  export type ColorVariant = 'dark' | '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 = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flowbite-svelte",
3
- "version": "0.46.9",
3
+ "version": "0.46.10",
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.10",
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
  },