flowbite-svelte 0.22.5 → 0.22.6

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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.22.6](https://github.com/themesberg/flowbite-svelte/compare/v0.22.5...v0.22.6) (2022-07-22)
6
+
7
+
8
+ ### Features
9
+
10
+ * select input [#50](https://github.com/themesberg/flowbite-svelte/issues/50) ([8cea993](https://github.com/themesberg/flowbite-svelte/commit/8cea993344f1427f83ab46f29a9bc1613c67960c))
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * add on:change to Radio ([074bd16](https://github.com/themesberg/flowbite-svelte/commit/074bd1677ced075971173c8abf1cf15387026efd))
16
+
5
17
  ### [0.22.5](https://github.com/themesberg/flowbite-svelte/compare/v0.22.4...v0.22.5) (2022-07-21)
6
18
 
7
19
 
@@ -1,6 +1,6 @@
1
1
  <script>import classNames from 'classnames';
2
2
  export let color = 'gray';
3
- export let defaultClass = 'text-sm font-medium';
3
+ export let defaultClass = 'text-sm font-medium block';
4
4
  export let show = true; // helper for inheritance
5
5
  let node;
6
6
  const colorClasses = {
@@ -40,6 +40,7 @@ export let value = '';
40
40
  type="radio"
41
41
  bind:group
42
42
  on:click
43
+ on:change
43
44
  {value}
44
45
  {...$$restProps}
45
46
  class={inputClass(custom, color, false, tinted, $$slots.default || $$props.class)}
@@ -14,6 +14,7 @@ declare const __propDef: {
14
14
  };
15
15
  events: {
16
16
  click: MouseEvent;
17
+ change: Event;
17
18
  } & {
18
19
  [evt: string]: CustomEvent<any>;
19
20
  };
@@ -1,7 +1,25 @@
1
- <script>export let value;
2
- export let selectClass = 'bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500';
1
+ <script>import classNames from 'classnames';
2
+ export let items = [];
3
+ export let value;
4
+ export let placeholder = 'Choose option ...';
5
+ export let underline = false;
6
+ export let size = 'md';
7
+ const common = 'block w-full';
8
+ export let defaultClass = 'text-gray-900 bg-gray-50 border border-gray-300 rounded-lg focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500';
9
+ export let underlineClass = 'text-gray-500 bg-transparent border-0 border-b-2 border-gray-200 appearance-none dark:text-gray-400 dark:border-gray-700 focus:outline-none focus:ring-0 focus:border-gray-200 peer';
10
+ const sizes = {
11
+ sm: 'text-sm p-2',
12
+ md: 'text-sm p-2.5',
13
+ lg: 'text-base py-3 px-4'
14
+ };
15
+ let selectClass;
16
+ $: selectClass = classNames(common, underline ? underlineClass : defaultClass, sizes[size], underline && '!px-0', $$restProps.class);
3
17
  </script>
4
18
 
5
- <select {...$$restProps} bind:value class={selectClass} on:change>
6
- <slot />
19
+ <select {...$$restProps} bind:value class={selectClass} on:change on:input>
20
+ <option disabled selected value="">{placeholder}</option>
21
+
22
+ {#each items as { value, name }}
23
+ <option {value}>{name}</option>
24
+ {/each}
7
25
  </select>
@@ -1,18 +1,23 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
+ import type { SelectOptionType } from '../types';
2
3
  declare const __propDef: {
3
4
  props: {
4
5
  [x: string]: any;
6
+ items?: SelectOptionType[];
5
7
  value: string | number;
6
- selectClass?: string;
8
+ placeholder?: string;
9
+ underline?: boolean;
10
+ size?: 'sm' | 'md' | 'lg';
11
+ defaultClass?: string;
12
+ underlineClass?: string;
7
13
  };
8
14
  events: {
9
15
  change: Event;
16
+ input: Event;
10
17
  } & {
11
18
  [evt: string]: CustomEvent<any>;
12
19
  };
13
- slots: {
14
- default: {};
15
- };
20
+ slots: {};
16
21
  };
17
22
  export declare type SelectProps = typeof __propDef.props;
18
23
  export declare type SelectEvents = typeof __propDef.events;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flowbite-svelte",
3
- "version": "0.22.5",
3
+ "version": "0.22.6",
4
4
  "description": "Flowbite components for Svelte",
5
5
  "main": "index.js",
6
6
  "author": {
@@ -58,12 +58,15 @@
58
58
  "dropdown",
59
59
  "footer",
60
60
  "forms",
61
+ "kbd",
61
62
  "list group",
62
- "modals",
63
+ "modal",
63
64
  "navbar",
64
65
  "paginations",
65
66
  "progress bars",
67
+ "rating",
66
68
  "sidebars",
69
+ "skeleton",
67
70
  "spinners",
68
71
  "tables",
69
72
  "tabs",