flowbite-svelte 0.21.13 → 0.21.16

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,36 @@
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.21.16](https://github.com/themesberg/flowbite-svelte/compare/v0.21.14...v0.21.16) (2022-07-20)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * dropdown search ([4416a31](https://github.com/themesberg/flowbite-svelte/commit/4416a312756331f6dd04b1d5fe5dd61b764fd38d))
11
+ * padding issues with dropdown ([6a48d4d](https://github.com/themesberg/flowbite-svelte/commit/6a48d4dc6a262fc62aa2d9b4c6233bf1cee4b741))
12
+ * padding issues with dropdown ([8e8c2d4](https://github.com/themesberg/flowbite-svelte/commit/8e8c2d4bed3e85e95c28e936c513489e6d975e8f))
13
+
14
+ ### [0.21.15](https://github.com/themesberg/flowbite-svelte/compare/v0.21.14...v0.21.15) (2022-07-20)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * dropdown search ([4416a31](https://github.com/themesberg/flowbite-svelte/commit/4416a312756331f6dd04b1d5fe5dd61b764fd38d))
20
+ * padding issues with dropdown ([6a48d4d](https://github.com/themesberg/flowbite-svelte/commit/6a48d4dc6a262fc62aa2d9b4c6233bf1cee4b741))
21
+ * padding issues with dropdown ([8e8c2d4](https://github.com/themesberg/flowbite-svelte/commit/8e8c2d4bed3e85e95c28e936c513489e6d975e8f))
22
+
23
+ ### [0.21.14](https://github.com/themesberg/flowbite-svelte/compare/v0.21.13...v0.21.14) (2022-07-19)
24
+
25
+
26
+ ### Features
27
+
28
+ * update floating label component ([d04caf9](https://github.com/themesberg/flowbite-svelte/commit/d04caf981a0cbbed37a82df1899d4584908b9171))
29
+
30
+
31
+ ### Bug Fixes
32
+
33
+ * multi-dropdown detach ([3ad1abb](https://github.com/themesberg/flowbite-svelte/commit/3ad1abb66e0fcb4ea53db8e0180e28b568e98aa6))
34
+
5
35
  ### [0.21.13](https://github.com/themesberg/flowbite-svelte/compare/v0.21.12...v0.21.13) (2022-07-19)
6
36
 
7
37
  ### [0.21.12](https://github.com/themesberg/flowbite-svelte/compare/v0.21.11...v0.21.12) (2022-07-19)
@@ -2,4 +2,4 @@
2
2
  export let divClass = 'my-1 h-px bg-gray-100 dark:bg-gray-600';
3
3
  </script>
4
4
 
5
- <div class={classNames(divClass, $$props.class)} {...$$restProps} />
5
+ <div {...$$restProps} class={classNames(divClass, $$props.class)} />
@@ -27,9 +27,10 @@ let inputClass; // get the value from the underlying Radio
27
27
  export let custom = false;
28
28
  export let color = 'blue';
29
29
  export let inline = false;
30
+ export let tinted = false;
30
31
  </script>
31
32
 
32
- <Radio class={$$restProps.class} bind:inputClass {color} {custom} {inline}>
33
+ <Radio class={$$restProps.class} bind:inputClass {color} {custom} {inline} {tinted}>
33
34
  <input
34
35
  slot="input"
35
36
  type="checkbox"
@@ -9,6 +9,7 @@ declare const __propDef: {
9
9
  custom?: boolean;
10
10
  color?: FormColorType;
11
11
  inline?: boolean;
12
+ tinted?: boolean;
12
13
  };
13
14
  events: {
14
15
  [evt: string]: CustomEvent<any>;
@@ -1,17 +1,97 @@
1
- <script>import generateId from '../utils/generateId.js';
1
+ <script>import classNames from 'classnames';
2
+ import generateId from '../utils/generateId.js';
2
3
  export let id = generateId();
3
- export let type;
4
+ export let style = 'standard';
5
+ export let type = 'text';
6
+ export let size = 'default';
7
+ export let color = 'base';
4
8
  export let value = '';
5
9
  export let label = '';
6
- export let divClass = 'relative z-0 mb-6 w-full group';
7
- export let inputClass = 'block py-2.5 px-0 w-full text-sm text-gray-900 bg-transparent border-0 border-b-2 border-gray-300 appearance-none dark:text-white dark:border-gray-600 dark:focus:border-blue-500 focus:outline-none focus:ring-0 focus:border-blue-600 peer';
8
- export let labelClass = 'absolute text-sm text-gray-500 dark:text-gray-400 duration-300 transform -translate-y-6 scale-75 top-3 -z-10 origin-[0] peer-focus:left-0 peer-focus:text-blue-600 peer-focus:dark:text-blue-500 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6';
10
+ const divClasses = {
11
+ filled: 'relative',
12
+ outlined: 'relative',
13
+ standard: 'relative z-0'
14
+ };
15
+ const inputSizes = {
16
+ filled: {
17
+ small: 'px-2.5 pb-1.5 pt-4',
18
+ default: 'px-2.5 pb-2.5 pt-5'
19
+ },
20
+ outlined: {
21
+ small: 'px-2.5 pb-1.5 pt-3',
22
+ default: 'px-2.5 pb-2.5 pt-4'
23
+ },
24
+ standard: {
25
+ small: 'py-2 px-0',
26
+ default: 'py-2.5 px-0'
27
+ }
28
+ };
29
+ const labelSizes = {
30
+ filled: {
31
+ small: 'top-3',
32
+ default: 'top-4'
33
+ },
34
+ outlined: {
35
+ small: 'top-1',
36
+ default: 'top-2'
37
+ },
38
+ standard: {
39
+ small: 'top-3',
40
+ default: 'top-3'
41
+ }
42
+ };
43
+ const inputClasses = {
44
+ filled: 'block rounded-t-lg w-full text-sm text-gray-900 bg-gray-50 dark:bg-gray-700 border-0 border-b-2 appearance-none dark:text-white focus:outline-none focus:ring-0 peer',
45
+ outlined: 'block w-full text-sm text-gray-900 bg-transparent rounded-lg border-1 appearance-none dark:text-white focus:outline-none focus:ring-0 peer',
46
+ standard: 'block w-full text-sm text-gray-900 bg-transparent border-0 border-b-2 appearance-none dark:text-white focus:outline-none focus:ring-0 peer'
47
+ };
48
+ const labelClasses = {
49
+ filled: 'absolute text-sm duration-300 transform -translate-y-4 scale-75 top-4 z-10 origin-[0] left-2.5 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-4',
50
+ outlined: 'absolute text-sm duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-white dark:bg-gray-900 px-2 peer-focus:px-2 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1',
51
+ standard: 'absolute text-sm duration-300 transform -translate-y-6 scale-75 top-3 -z-10 origin-[0] peer-focus:left-0 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6'
52
+ };
53
+ const inputColorClasses = {
54
+ base: 'border-gray-300 dark:border-gray-600 dark:focus:border-blue-500 focus:border-blue-600',
55
+ green: 'border-green-600 dark:border-green-500 dark:focus:border-green-500 focus:border-green-600',
56
+ red: 'border-red-600 dark:border-red-500 dark:focus:border-red-500 focus:border-red-600'
57
+ };
58
+ const labelColorClasses = {
59
+ base: 'text-gray-500 dark:text-gray-400 peer-focus:text-blue-600 peer-focus:dark:text-blue-500',
60
+ green: 'text-green-600 dark:text-green-500',
61
+ red: 'text-red-600 dark:text-red-500'
62
+ };
63
+ export let ref = null;
64
+ // you need to this to avoid 2-way binding
9
65
  function setType(node) {
10
66
  node.type = type;
11
67
  }
12
68
  </script>
13
69
 
14
- <div class={divClass}>
15
- <input {...$$restProps} bind:value use:setType class={inputClass} placeholder=" " />
16
- <label for={id} class={labelClass}>{label}</label>
70
+ <div class={divClasses[style]}>
71
+ <input
72
+ {id}
73
+ {...$$restProps}
74
+ bind:value
75
+ bind:this={ref}
76
+ use:setType
77
+ placeholder=" "
78
+ class={classNames(
79
+ inputClasses[style],
80
+ inputColorClasses[color],
81
+ inputSizes[style][size],
82
+ $$props.class
83
+ )}
84
+ />
85
+
86
+ <label
87
+ for={id}
88
+ class={classNames(
89
+ labelClasses[style],
90
+ labelColorClasses[color],
91
+ labelSizes[style][size],
92
+ $$props.labelClass
93
+ )}
94
+ >
95
+ {label}
96
+ </label>
17
97
  </div>
@@ -4,12 +4,13 @@ declare const __propDef: {
4
4
  props: {
5
5
  [x: string]: any;
6
6
  id?: string;
7
- type: InputType;
7
+ style?: 'filled' | 'outlined' | 'standard';
8
+ type?: InputType;
9
+ size?: 'small' | 'default';
10
+ color?: 'base' | 'green' | 'red';
8
11
  value?: string;
9
12
  label?: string;
10
- divClass?: string;
11
- inputClass?: string;
12
- labelClass?: string;
13
+ ref?: HTMLElement;
13
14
  };
14
15
  events: {
15
16
  [evt: string]: CustomEvent<any>;
@@ -15,10 +15,11 @@ import classNames from 'classnames';
15
15
  export let color = 'blue';
16
16
  export let custom = false;
17
17
  export let inline = false;
18
+ export let tinted = false;
18
19
  export let group = '';
19
20
  export let value = '';
20
21
  export let inputClass;
21
- $: inputClass = classNames('w-4 h-4 bg-gray-100 border-gray-300 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600 mr-2', custom && 'sr-only peer', colorClasses[color]);
22
+ $: inputClass = classNames('w-4 h-4 bg-gray-100 border-gray-300 dark:ring-offset-gray-800 focus:ring-2 mr-2', tinted ? 'dark:bg-gray-600 dark:border-gray-500' : 'dark:bg-gray-700 dark:border-gray-600', custom && 'sr-only peer', colorClasses[color]);
22
23
  let colorLabel = 'gray';
23
24
  $: colorLabel = $$restProps.disabled ? 'disabled' : colorLabel;
24
25
  let labelClass;
@@ -6,6 +6,7 @@ declare const __propDef: {
6
6
  color?: FormColorType;
7
7
  custom?: boolean;
8
8
  inline?: boolean;
9
+ tinted?: boolean;
9
10
  group?: number | string;
10
11
  value?: string;
11
12
  inputClass: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flowbite-svelte",
3
- "version": "0.21.13",
3
+ "version": "0.21.16",
4
4
  "description": "Flowbite components for Svelte",
5
5
  "main": "index.js",
6
6
  "author": {