flowbite-svelte 0.24.7 → 0.24.8

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,14 @@
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.24.8](https://github.com/themesberg/flowbite-svelte/compare/v0.24.7...v0.24.8) (2022-08-12)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * change function clickOutside to arrow function ([71e71e0](https://github.com/themesberg/flowbite-svelte/commit/71e71e0e482ad9939f9d135b1608b5cc8d31d899))
11
+ * update createprops and update props ([0739b92](https://github.com/themesberg/flowbite-svelte/commit/0739b9296caddcba85f849b222e6548a961dbd34))
12
+
5
13
  ### [0.24.7](https://github.com/themesberg/flowbite-svelte/compare/v0.24.5...v0.24.7) (2022-08-11)
6
14
 
7
15
 
@@ -5,6 +5,8 @@ import { ChevronDown, ChevronUp } from 'svelte-heros';
5
5
  export let id = '';
6
6
  export let btnClass = 'flex justify-between items-center py-5 w-full font-medium text-left text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400';
7
7
  export let slotClass = 'py-5 border-b border-gray-200 dark:border-gray-700';
8
+ export let iconSize = 24;
9
+ export let iconClass = 'text-gray-500 sm:w-6 sm:h-6 dark:text-gray-300';
8
10
  export let isOpen = false;
9
11
  export let icons = {
10
12
  up: ChevronUp,
@@ -18,8 +20,6 @@ onMount(() => {
18
20
  const handleToggle = (id) => {
19
21
  isOpen = !isOpen;
20
22
  };
21
- export let iconSize = 24;
22
- export let iconClass = 'text-gray-500 sm:w-6 sm:h-6 dark:text-gray-300';
23
23
  </script>
24
24
 
25
25
  <h2 aria-expanded={isOpen}>
@@ -6,10 +6,10 @@ declare const __propDef: {
6
6
  id?: string;
7
7
  btnClass?: string;
8
8
  slotClass?: string;
9
- isOpen?: boolean;
10
- icons?: AccordionIconType;
11
9
  iconSize?: number;
12
10
  iconClass?: string;
11
+ isOpen?: boolean;
12
+ icons?: AccordionIconType;
13
13
  };
14
14
  events: {
15
15
  [evt: string]: CustomEvent<any>;
@@ -28,7 +28,7 @@ export let captionClass = 'h-10 bg-gray-300 dark:bg-gray-700 dark:text-white p-2
28
28
  // Indicator
29
29
  export let indicatorClass = 'w-3 h-3 rounded-full bg-gray-100 hover:bg-gray-300 opacity-60';
30
30
  // have a custom transition function that returns the desired transition
31
- function multiple(node, params) {
31
+ const multiple = (node, params) => {
32
32
  switch (transitionType) {
33
33
  case 'slide':
34
34
  return slide(node, params);
@@ -39,7 +39,7 @@ function multiple(node, params) {
39
39
  case 'fade':
40
40
  return fade(node, params);
41
41
  }
42
- }
42
+ };
43
43
  // Slide
44
44
  // export let slideClass: string = 'hidden';
45
45
  let imageShowingIndex = 1;
@@ -9,9 +9,9 @@ export let spanClass = 'inline-flex items-center px-3 text-sm text-gray-900 bg-g
9
9
  export let noBorderInputClass = 'bg-gray-50 border border-gray-300 text-gray-900 rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 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';
10
10
  export let noBorderDivClass = 'flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none';
11
11
  export let iconClass = 'mr-2';
12
- function setType(node) {
12
+ const setType = (node) => {
13
13
  node.type = type;
14
- }
14
+ };
15
15
  </script>
16
16
 
17
17
  {#if noBorder}
@@ -13,9 +13,9 @@ const colorClasses = {
13
13
  // tinted if put in component having its own background
14
14
  let background = getContext('background');
15
15
  // you need to this to avoid 2-way binding
16
- function setType(node) {
16
+ const setType = (node) => {
17
17
  node.type = type;
18
- }
18
+ };
19
19
  </script>
20
20
 
21
21
  <input
@@ -7,11 +7,11 @@ let wrapperClass;
7
7
  $: wrapperClass = classNames('border-gray-100 shadow-md dark:border-gray-700', full ? 'border-y' : 'rounded-lg border', full ? 'bg-white dark:bg-gray-800' : 'bg-white dark:bg-gray-700', $$props.class);
8
8
  let ulClass;
9
9
  $: ulClass = classNames('grid grid-flow-row gap-y-4 md:gap-x-0 auto-col-max auto-row-max', full && $$slots.extra ? 'grid-cols-2' : 'grid-cols-2 md:grid-cols-3', 'text-sm font-medium', 'text-gray-500 dark:text-gray-400', full && $$slots.extra && 'md:w-2/3');
10
- function init(node) {
10
+ const init = (node) => {
11
11
  if (full) {
12
12
  node.parentElement.classList.add('inset-x-0');
13
13
  }
14
- }
14
+ };
15
15
  </script>
16
16
 
17
17
  <div class={wrapperClass} use:init>
@@ -18,7 +18,7 @@ const allPlacementClasses = [
18
18
  'items-end'
19
19
  ];
20
20
  let backdropEl;
21
- function init(node, _open) {
21
+ const init = (node, _open) => {
22
22
  getPlacementClasses().map((c) => node.classList.add(c));
23
23
  _open && createBackdrop(node);
24
24
  return {
@@ -31,12 +31,12 @@ function init(node, _open) {
31
31
  destroyBackdrop(node);
32
32
  }
33
33
  };
34
- }
35
- function handleEscape(e) {
34
+ };
35
+ const handleEscape = (e) => {
36
36
  if (open && e.key === 'Escape')
37
37
  open = false;
38
- }
39
- function createBackdrop(node) {
38
+ };
39
+ const createBackdrop = (node) => {
40
40
  if (!backdropEl) {
41
41
  backdropEl = document.createElement('div');
42
42
  backdropEl.classList.add(...backdropClasses.split(' '));
@@ -46,8 +46,8 @@ function createBackdrop(node) {
46
46
  document.addEventListener('keydown', handleEscape, true);
47
47
  }
48
48
  dispatch('show', node);
49
- }
50
- function destroyBackdrop(node) {
49
+ };
50
+ const destroyBackdrop = (node) => {
51
51
  const body = document.querySelector('body');
52
52
  body.style.overflow = 'auto';
53
53
  if (backdropEl)
@@ -55,8 +55,8 @@ function destroyBackdrop(node) {
55
55
  backdropEl = undefined;
56
56
  document.removeEventListener('keydown', handleEscape, true);
57
57
  dispatch('hide', node);
58
- }
59
- function getPlacementClasses() {
58
+ };
59
+ const getPlacementClasses = () => {
60
60
  switch (placement) {
61
61
  // top
62
62
  case 'top-left':
@@ -82,7 +82,7 @@ function getPlacementClasses() {
82
82
  default:
83
83
  return ['justify-center', 'items-center'];
84
84
  }
85
- }
85
+ };
86
86
  const sizes = {
87
87
  xs: 'max-w-md',
88
88
  sm: 'max-w-lg',
@@ -90,13 +90,13 @@ const sizes = {
90
90
  lg: 'max-w-4xl',
91
91
  xl: 'max-w-7xl'
92
92
  };
93
- function onButtonsClick({ target }) {
93
+ const onButtonsClick = ({ target }) => {
94
94
  if (autoclose && target.tagName === 'BUTTON')
95
95
  open = !open;
96
- }
97
- function hide() {
96
+ };
97
+ const hide = () => {
98
98
  open = false;
99
- }
99
+ };
100
100
  </script>
101
101
 
102
102
  <!-- Main modal -->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flowbite-svelte",
3
- "version": "0.24.7",
3
+ "version": "0.24.8",
4
4
  "description": "Flowbite components for Svelte",
5
5
  "main": "index.js",
6
6
  "author": {
@@ -12,33 +12,33 @@
12
12
  "homepage": "https://flowbite-svelte.com/",
13
13
  "license": "MIT",
14
14
  "devDependencies": {
15
- "@playwright/test": "^1.23.4",
15
+ "@playwright/test": "^1.25.0",
16
16
  "@sveltejs/adapter-auto": "next",
17
17
  "@sveltejs/kit": "next",
18
- "@typescript-eslint/eslint-plugin": "^5.30.7",
19
- "@typescript-eslint/parser": "^5.30.7",
20
- "autoprefixer": "^10.4.4",
21
- "createprops": "^0.4.4",
22
- "eslint": "^8.20.0",
18
+ "@typescript-eslint/eslint-plugin": "^5.33.0",
19
+ "@typescript-eslint/parser": "^5.33.0",
20
+ "autoprefixer": "^10.4.8",
21
+ "createprops": "^0.4.9",
22
+ "eslint": "^8.21.0",
23
23
  "eslint-config-prettier": "^8.5.0",
24
24
  "eslint-plugin-svelte3": "^4.0.0",
25
25
  "mdsvex": "^0.10.6",
26
- "postcss": "^8.4.14",
26
+ "postcss": "^8.4.16",
27
27
  "postcss-load-config": "3.1.4",
28
28
  "prettier": "^2.7.1",
29
29
  "prettier-plugin-svelte": "^2.7.0",
30
30
  "prism-themes": "^1.9.0",
31
- "svelte": "^3.47.0",
31
+ "svelte": "^3.49.0",
32
32
  "svelte-check": "^2.8.0",
33
- "svelte-flag-icons": "^0.1.0",
33
+ "svelte-flag-icons": "^0.1.1",
34
34
  "svelte-heros": "^2.3.3",
35
35
  "svelte-preprocess": "^4.10.7",
36
- "svelte-sidebar-menu": "^0.8.4",
37
- "svelte2tsx": "^0.5.11",
38
- "tailwindcss": "^3.1.6",
39
- "tslib": "^2.3.1",
36
+ "svelte-sidebar-menu": "^0.8.11",
37
+ "svelte2tsx": "^0.5.13",
38
+ "tailwindcss": "^3.1.8",
39
+ "tslib": "^2.4.0",
40
40
  "typescript": "~4.7.4",
41
- "vite": "^3.0.2"
41
+ "vite": "^3.0.7"
42
42
  },
43
43
  "type": "module",
44
44
  "keywords": [
@@ -81,9 +81,9 @@
81
81
  "url": "https://github.com/themesberg/flowbite-svelte"
82
82
  },
83
83
  "dependencies": {
84
- "@floating-ui/dom": "^0.5.3",
84
+ "@floating-ui/dom": "^0.5.4",
85
85
  "classnames": "^2.3.1",
86
- "flowbite": "^1.4.2"
86
+ "flowbite": "^1.5.2"
87
87
  },
88
88
  "engines": {
89
89
  "npm": ">=7.0.0",
@@ -1,7 +1,7 @@
1
1
  <script>import { createEventDispatcher } from 'svelte';
2
- export let helper = undefined;
3
2
  export let btnPreClass = 'py-2 px-4 text-sm font-medium text-white bg-gray-800 rounded-l hover:bg-gray-900 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white';
4
3
  export let btnNextClass = 'py-2 px-4 text-sm font-medium text-white bg-gray-800 rounded-r border-0 border-l border-gray-700 hover:bg-gray-900 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white';
4
+ export let helper = undefined;
5
5
  const dispatch = createEventDispatcher();
6
6
  const previous = () => {
7
7
  dispatch('previous');
@@ -1,13 +1,10 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
+ import type { TableDataHelperType } from '../types';
2
3
  declare const __propDef: {
3
4
  props: {
4
- helper?: {
5
- start: number;
6
- end: number;
7
- total: number;
8
- } | undefined;
9
5
  btnPreClass?: string;
10
6
  btnNextClass?: string;
7
+ helper?: TableDataHelperType | undefined;
11
8
  };
12
9
  events: {
13
10
  blur: FocusEvent;
@@ -1,11 +1,16 @@
1
1
  <script>import classNames from 'classnames';
2
2
  export let review;
3
+ export let articleClass = 'md:gap-8 md:grid md:grid-cols-3';
4
+ export let divClass = 'flex items-center mb-6 space-x-4';
5
+ export let imgClass = 'w-10 h-10 rounded-full';
6
+ export let ulClass = 'space-y-4 text-sm text-gray-500 dark:text-gray-400';
7
+ export let liClass = 'flex items-center';
3
8
  </script>
4
9
 
5
- <article class="md:gap-8 md:grid md:grid-cols-3">
10
+ <article class={classNames(articleClass, $$props.classArticle)}>
6
11
  <div>
7
- <div class="flex items-center mb-6 space-x-4">
8
- <img class="w-10 h-10 rounded-full" src={review.imgSrc} alt={review.imgAlt} />
12
+ <div class={classNames(divClass, $$props.classDiv)}>
13
+ <img class={classNames(imgClass, $$props.classImg)} src={review.imgSrc} alt={review.imgAlt} />
9
14
  <div class="space-y-1 font-medium dark:text-white">
10
15
  <p>{review.name}</p>
11
16
  {#if review.address}
@@ -19,19 +24,19 @@ export let review;
19
24
  </div>
20
25
  </div>
21
26
  {#if $$slots.item || $$slots.option1 || $$slots.option2}
22
- <ul class="space-y-4 text-sm text-gray-500 dark:text-gray-400">
27
+ <ul class={classNames(ulClass, $$props.classUl)}>
23
28
  {#if $$slots.item}
24
- <li class="flex items-center">
29
+ <li class={classNames(liClass, $$props.classLi)}>
25
30
  <slot name="item" />
26
31
  </li>
27
32
  {/if}
28
33
  {#if $$slots.option1}
29
- <li class="flex items-center">
34
+ <li class={classNames(liClass, $$props.classLi)}>
30
35
  <slot name="option1" />
31
36
  </li>
32
37
  {/if}
33
38
  {#if $$slots.option2}
34
- <li class="flex items-center">
39
+ <li class={classNames(liClass, $$props.classLi)}>
35
40
  <slot name="option2" />
36
41
  </li>
37
42
  {/if}
@@ -1,23 +1,14 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
- import type { SvelteComponent } from 'svelte';
2
+ import type { ReviewType } from '../types';
3
3
  declare const __propDef: {
4
4
  props: {
5
- review: {
6
- name: string;
7
- imgSrc: string;
8
- imgAlt: string;
9
- address: string | undefined;
10
- addressIcon: typeof SvelteComponent | undefined;
11
- reviewDate: string | undefined;
12
- title: string;
13
- rating: number;
14
- item: string | undefined;
15
- itemIcon: typeof SvelteComponent | undefined;
16
- option1: string | undefined;
17
- option1Icon: typeof SvelteComponent | undefined;
18
- option2: string | undefined;
19
- option2Icon: typeof SvelteComponent | undefined;
20
- };
5
+ [x: string]: any;
6
+ review: ReviewType;
7
+ articleClass?: string;
8
+ divClass?: string;
9
+ imgClass?: string;
10
+ ulClass?: string;
11
+ liClass?: string;
21
12
  };
22
13
  events: {
23
14
  [evt: string]: CustomEvent<any>;
package/types.d.ts CHANGED
@@ -148,6 +148,22 @@ export interface PillTabType {
148
148
  selected: boolean;
149
149
  href: string;
150
150
  }
151
+ export declare type ReviewType = {
152
+ name: string;
153
+ imgSrc: string;
154
+ imgAlt: string;
155
+ address: string | undefined;
156
+ addressIcon: typeof SvelteComponent | undefined;
157
+ reviewDate: string | undefined;
158
+ title: string;
159
+ rating: number;
160
+ item: string | undefined;
161
+ itemIcon: typeof SvelteComponent | undefined;
162
+ option1: string | undefined;
163
+ option1Icon: typeof SvelteComponent | undefined;
164
+ option2: string | undefined;
165
+ option2Icon: typeof SvelteComponent | undefined;
166
+ };
151
167
  export declare type SelectOptionType = {
152
168
  name: string;
153
169
  value: string;
@@ -193,6 +209,11 @@ export interface TabType {
193
209
  href: string;
194
210
  rel?: string;
195
211
  }
212
+ export interface TableDataHelperType {
213
+ start: number;
214
+ end: number;
215
+ total: number;
216
+ }
196
217
  export declare type Textsize = 'text-xs' | 'text-sm' | 'text-base' | 'text-lg' | 'text-xl' | 'text-2xl' | 'text-3xl' | 'text-4xl';
197
218
  export interface TimelineItemType {
198
219
  date: Date | string;
@@ -1,3 +1,3 @@
1
- export declare function clickOutside(node: HTMLElement, callback: () => void): {
1
+ export declare const clickOutside: (node: HTMLElement, callback: () => void) => {
2
2
  destroy(): void;
3
3
  };
@@ -1,4 +1,4 @@
1
- export function clickOutside(node, callback) {
1
+ export const clickOutside = (node, callback) => {
2
2
  const handleClick = (event) => {
3
3
  if (!event?.target)
4
4
  return;
@@ -12,4 +12,4 @@ export function clickOutside(node, callback) {
12
12
  document.removeEventListener('click', handleClick, true);
13
13
  },
14
14
  };
15
- }
15
+ };