flowbite-svelte 0.27.6 → 0.27.9

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,28 @@
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.27.9](https://github.com/themesberg/flowbite-svelte/compare/v0.27.8...v0.27.9) (2022-10-19)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * [#379](https://github.com/themesberg/flowbite-svelte/issues/379) ([#380](https://github.com/themesberg/flowbite-svelte/issues/380)) ([0019915](https://github.com/themesberg/flowbite-svelte/commit/001991546e3e7376a02c17481784c5a5636d6ed7))
11
+ * optional Frame transition' ([#385](https://github.com/themesberg/flowbite-svelte/issues/385)) ([e7fc8db](https://github.com/themesberg/flowbite-svelte/commit/e7fc8db0f920e3bd907ce9fcf1c532885da193af))
12
+ * restProps for NumberInput ([#382](https://github.com/themesberg/flowbite-svelte/issues/382)) ([d1acb7f](https://github.com/themesberg/flowbite-svelte/commit/d1acb7f1b22a69acfc0f1ab6d2859c2a7d8a082c))
13
+
14
+ ### [0.27.8](https://github.com/themesberg/flowbite-svelte/compare/v0.27.7...v0.27.8) (2022-10-17)
15
+
16
+ ### [0.27.7](https://github.com/themesberg/flowbite-svelte/compare/v0.27.6...v0.27.7) (2022-10-17)
17
+
18
+
19
+ ### Bug Fixes
20
+
21
+ * [#376](https://github.com/themesberg/flowbite-svelte/issues/376) ([#378](https://github.com/themesberg/flowbite-svelte/issues/378)) ([8b4c2e3](https://github.com/themesberg/flowbite-svelte/commit/8b4c2e3200c73448aa34f921738e8ea8d10ee538))
22
+ * card - restProps ([#373](https://github.com/themesberg/flowbite-svelte/issues/373)) ([a7331fc](https://github.com/themesberg/flowbite-svelte/commit/a7331fcd5915e6142a99859113776ce74a72529a))
23
+ * flitering ([#370](https://github.com/themesberg/flowbite-svelte/issues/370)) ([e8ac071](https://github.com/themesberg/flowbite-svelte/commit/e8ac07134518a373949da3fadc4f63c656fe2d59))
24
+ * modal arrow keys ([#369](https://github.com/themesberg/flowbite-svelte/issues/369)) ([2a8bc1c](https://github.com/themesberg/flowbite-svelte/commit/2a8bc1c156c66a3dc0569312343b6f6b65a051ea))
25
+ * remove |local from Frame componentso that toast transitions work ([6da412c](https://github.com/themesberg/flowbite-svelte/commit/6da412c0665f27a6f9dd33bbf89758c4a924d239))
26
+
5
27
  ### [0.27.6](https://github.com/themesberg/flowbite-svelte/compare/v0.27.5...v0.27.6) (2022-10-09)
6
28
 
7
29
 
package/README.md CHANGED
@@ -446,4 +446,4 @@ Please read [How to contribute](https://github.com/themesberg/flowbite-svelte/bl
446
446
 
447
447
  ## Changelog
448
448
 
449
- [Changelog](https://github.com/themesberg/flowbite-svelte/blob/main/CHANGELOG.md)
449
+ [Changelog](https://github.com/themesberg/flowbite-svelte/blob/main/CHANGELOG.md)
@@ -4,7 +4,7 @@
4
4
  <script>import Frame from '../utils/Frame.svelte';
5
5
  import classNames from 'classnames';
6
6
  import { setContext } from 'svelte';
7
- export let single = true;
7
+ export let multiple = false;
8
8
  export let flush = false;
9
9
  export let activeClasses = 'bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-800';
10
10
  export let inactiveClasses = 'text-gray-500 dark:text-gray-400 hover:bg-gray-100 hover:dark:bg-gray-800';
@@ -13,7 +13,7 @@ const ctx = {
13
13
  flush,
14
14
  activeClasses,
15
15
  inactiveClasses,
16
- selected: single ? writable() : undefined
16
+ selected: multiple ? undefined : writable()
17
17
  };
18
18
  setContext('ctx', ctx);
19
19
  let frameClass = classNames(defaultClass, 'divide-y divide-gray-200 dark:divide-gray-700', 'border-gray-200 dark:border-gray-700', 'rounded-t-xl', $$props.class);
@@ -9,7 +9,7 @@ export interface AccordionCtxType {
9
9
  declare const __propDef: {
10
10
  props: {
11
11
  [x: string]: any;
12
- single?: boolean | undefined;
12
+ multiple?: boolean | undefined;
13
13
  flush?: boolean | undefined;
14
14
  activeClasses?: string | undefined;
15
15
  inactiveClasses?: string | undefined;
@@ -12,8 +12,10 @@ const ctx = getContext('ctx') ?? {};
12
12
  // single selection
13
13
  const self = {};
14
14
  const selected = ctx.selected ?? writable();
15
+ let _open = open;
16
+ open = false;
15
17
  onMount(() => {
16
- if (open)
18
+ if (_open)
17
19
  $selected = self;
18
20
  // this will trigger unsubscribe on destroy
19
21
  return selected.subscribe((x) => (open = x === self));
package/cards/Card.svelte CHANGED
@@ -28,7 +28,7 @@ let imgClass;
28
28
  $: imgClass = classNames(reverse ? 'rounded-b-lg' : 'rounded-t-lg', horizontal && 'object-cover w-full h-96 md:h-auto md:w-48 md:rounded-none', horizontal && (reverse ? 'md:rounded-r-lg' : 'md:rounded-l-lg'));
29
29
  </script>
30
30
 
31
- <Frame tag={href ? 'a' : 'div'} rounded shadow border {href} class={cardClass}>
31
+ <Frame tag={href ? 'a' : 'div'} rounded shadow border {href} {...$$restProps} class={cardClass}>
32
32
  {#if img}
33
33
  <img class={imgClass} src={img} alt="" />
34
34
  <div class={innerPdding}>
@@ -6,6 +6,7 @@ export let thumbWidth;
6
6
  export let selected = false;
7
7
  </script>
8
8
 
9
+ <!-- svelte-ignore a11y-click-events-have-key-events -->
9
10
  <img
10
11
  class="opacity-40"
11
12
  class:active={selected}
@@ -43,7 +43,7 @@ let backdropDivClass = classNames('fixed top-0 left-0 z-50 w-full h-full', backd
43
43
 
44
44
  {#if !hidden}
45
45
  {#if backdrop && activateClickOutside}
46
- <div class={backdropDivClass} on:click={() => !hidden && handleDrawer()} />
46
+ <div role="presentation" class={backdropDivClass} on:click={() => !hidden && handleDrawer()} />
47
47
  {/if}
48
48
  {#if activateClickOutside}
49
49
  <div
@@ -2,6 +2,6 @@
2
2
  export let value = 0;
3
3
  </script>
4
4
 
5
- <Input let:props>
5
+ <Input let:props {...$$restProps}>
6
6
  <input {...props} type="number" bind:value />
7
7
  </Input>
@@ -1,6 +1,7 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
2
  declare const __propDef: {
3
3
  props: {
4
+ [x: string]: any;
4
5
  value?: number | undefined;
5
6
  };
6
7
  events: {
package/index.d.ts CHANGED
@@ -91,10 +91,8 @@ export { default as TableBodyRow } from './tables/TableBodyRow.svelte';
91
91
  export { default as TableHead } from './tables/TableHead.svelte';
92
92
  export { default as TableHeadCell } from './tables/TableHeadCell.svelte';
93
93
  export { default as TableSearch } from './tables/TableSearch.svelte';
94
- export { default as TabHead } from './tabs/TabHead.svelte';
95
- export { default as TabHeadItem } from './tabs/TabHeadItem.svelte';
96
- export { default as TabContentItem } from './tabs/TabContentItem.svelte';
97
- export { default as TabWrapper } from './tabs/TabWrapper.svelte';
94
+ export { default as TabItem } from './tabs/TabItem.svelte';
95
+ export { default as Tabs } from './tabs/Tabs.svelte';
98
96
  export { default as Group } from './timelines/Group.svelte';
99
97
  export { default as GroupItem } from './timelines/GroupItem.svelte';
100
98
  export { default as Activity } from './timelines/Activity.svelte';
package/index.js CHANGED
@@ -120,10 +120,8 @@ export { default as TableHead } from './tables/TableHead.svelte';
120
120
  export { default as TableHeadCell } from './tables/TableHeadCell.svelte';
121
121
  export { default as TableSearch } from './tables/TableSearch.svelte';
122
122
  // Tabs
123
- export { default as TabHead } from './tabs/TabHead.svelte';
124
- export { default as TabHeadItem } from './tabs/TabHeadItem.svelte';
125
- export { default as TabContentItem } from './tabs/TabContentItem.svelte';
126
- export { default as TabWrapper } from './tabs/TabWrapper.svelte';
123
+ export { default as TabItem } from './tabs/TabItem.svelte';
124
+ export { default as Tabs } from './tabs/Tabs.svelte';
127
125
  // Timeline
128
126
  export { default as Group } from './timelines/Group.svelte';
129
127
  export { default as GroupItem } from './timelines/GroupItem.svelte';
@@ -12,7 +12,17 @@ export let permanent = false;
12
12
  export let backdropClasses = 'bg-gray-900 bg-opacity-50 dark:bg-opacity-80';
13
13
  const dispatch = createEventDispatcher();
14
14
  $: dispatch(open ? 'open' : 'hide');
15
- function grabFocus(node) {
15
+ function prepareFocus(node) {
16
+ const walker = document.createTreeWalker(node, NodeFilter.SHOW_ELEMENT);
17
+ let n;
18
+ while ((n = walker.nextNode())) {
19
+ if (n instanceof HTMLElement) {
20
+ const el = n;
21
+ const [x, y] = isScrollable(el);
22
+ if (x || y)
23
+ el.tabIndex = 0;
24
+ }
25
+ }
16
26
  node.focus();
17
27
  }
18
28
  const getPlacementClasses = () => {
@@ -63,22 +73,14 @@ const isScrollable = (e) => [
63
73
  e.scrollWidth > e.clientWidth && ['scroll', 'auto'].indexOf(getComputedStyle(e).overflowX) >= 0,
64
74
  e.scrollHeight > e.clientHeight && ['scroll', 'auto'].indexOf(getComputedStyle(e).overflowY) >= 0
65
75
  ];
66
- const isArrowKey = (e, x, y) => (x && ['ArrowLeft', 'ArrowRight'].includes(e.key)) || (y && ['ArrowDown', 'ArrowUp'].includes(e.key));
67
76
  function preventWheelDefault(e) {
68
77
  // @ts-ignore
69
78
  const [x, y] = isScrollable(this);
70
79
  return x || y || e.preventDefault();
71
80
  }
72
- function stopArrowsPropagation(e) {
73
- // @ts-ignore
74
- const [x, y] = isScrollable(this);
75
- if (isArrowKey(e, x, y))
76
- e.stopPropagation();
77
- }
78
81
  function handleKeys(e) {
79
82
  if (e.key === 'Escape' && !permanent)
80
83
  return hide();
81
- return isArrowKey(e, true, true) ? e.preventDefault() : true;
82
84
  }
83
85
  </script>
84
86
 
@@ -88,9 +90,9 @@ function handleKeys(e) {
88
90
  class={mainClass}
89
91
  aria-modal="true"
90
92
  role="dialog"
91
- on:keydown={handleKeys}
93
+ on:keydown|preventDefault={handleKeys}
92
94
  on:wheel|preventDefault
93
- use:grabFocus
95
+ use:prepareFocus
94
96
  use:focusTrap
95
97
  on:click={autoclose ? onAutoClose : null}>
96
98
  <div class="flex p-4 w-full {sizes[size]} h-full md:h-auto max-h-screen">
@@ -111,8 +113,9 @@ function handleKeys(e) {
111
113
  {/if}
112
114
  <!-- Modal body -->
113
115
  <div
116
+ id="modal"
114
117
  class="p-6 space-y-6 flex-1 overflow-y-auto overscroll-contain"
115
- on:keydown={stopArrowsPropagation}
118
+ on:keydown|stopPropagation={handleKeys}
116
119
  on:wheel|stopPropagation={preventWheelDefault}>
117
120
  <slot />
118
121
  </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flowbite-svelte",
3
- "version": "0.27.6",
3
+ "version": "0.27.9",
4
4
  "description": "Flowbite components for Svelte",
5
5
  "main": "index.js",
6
6
  "author": {
@@ -13,7 +13,7 @@
13
13
  "license": "MIT",
14
14
  "devDependencies": {
15
15
  "@playwright/test": "^1.25.0",
16
- "@sveltejs/adapter-auto": "1.0.0-next.75",
16
+ "@sveltejs/adapter-vercel": "1.0.0-next.78",
17
17
  "@sveltejs/kit": "1.0.0-next.484",
18
18
  "@sveltejs/package": "1.0.0-next.3",
19
19
  "@typescript-eslint/eslint-plugin": "^5.27.0",
@@ -205,10 +205,10 @@
205
205
  "./tables/TableHead.svelte": "./tables/TableHead.svelte",
206
206
  "./tables/TableHeadCell.svelte": "./tables/TableHeadCell.svelte",
207
207
  "./tables/TableSearch.svelte": "./tables/TableSearch.svelte",
208
- "./tabs/TabContentItem.svelte": "./tabs/TabContentItem.svelte",
209
208
  "./tabs/TabHead.svelte": "./tabs/TabHead.svelte",
210
209
  "./tabs/TabHeadItem.svelte": "./tabs/TabHeadItem.svelte",
211
- "./tabs/TabWrapper.svelte": "./tabs/TabWrapper.svelte",
210
+ "./tabs/TabItem.svelte": "./tabs/TabItem.svelte",
211
+ "./tabs/Tabs.svelte": "./tabs/Tabs.svelte",
212
212
  "./timelines/Activity.svelte": "./timelines/Activity.svelte",
213
213
  "./timelines/ActivityItem.svelte": "./timelines/ActivityItem.svelte",
214
214
  "./timelines/Group.svelte": "./timelines/Group.svelte",
@@ -1,12 +1,13 @@
1
1
  <script>export let tabStyle = 'default';
2
2
  export let customDivClass = '';
3
3
  export let customUlClass = '';
4
+ const border = 'border-b border-gray-200 dark:border-gray-700';
4
5
  const divClasses = {
5
- default: 'mb-4 border-b border-gray-200 dark:border-gray-700',
6
+ default: 'mb-4 ' + border,
6
7
  full: 'mb-4',
7
- icon: 'mb-4 border-b border-gray-200 dark:border-gray-700',
8
+ icon: 'mb-4 ' + border,
8
9
  pill: 'mb-4 ',
9
- underline: 'mb-4 text-sm font-medium text-center text-gray-500 border-b border-gray-200 dark:text-gray-400 dark:border-gray-700',
10
+ underline: 'mb-4 text-sm font-medium text-center text-gray-500 dark:text-gray-400 ' + border,
10
11
  custom: customDivClass
11
12
  };
12
13
  const ulClasses = {
@@ -5,6 +5,9 @@ export let activeTabValue;
5
5
  export let customActiveClass = '';
6
6
  export let customInActiveClass = '';
7
7
  export let customLiClass = '';
8
+ import { getContext } from 'svelte';
9
+ const ctx = getContext('ctx') ?? {};
10
+ tabStyle = ctx.style;
8
11
  const activeClasses = {
9
12
  default: 'inline-block py-4 px-4 text-sm font-medium text-center text-blue-600 bg-gray-100 rounded-t-lg active dark:bg-gray-800 dark:text-blue-500',
10
13
  full: 'inline-block p-4 w-full text-gray-900 bg-gray-100 focus:ring-4 focus:ring-blue-300 active focus:outline-none dark:bg-gray-700 dark:text-white',
@@ -0,0 +1,53 @@
1
+ <script>import { getContext } from 'svelte';
2
+ import { writable } from 'svelte/store';
3
+ import classNames from 'classnames';
4
+ export let open = false;
5
+ export let title = 'Tab title';
6
+ export let activeClasses = undefined;
7
+ export let inactiveClasses = undefined;
8
+ export let defaultClass = 'inline-block text-sm font-medium text-center disabled:cursor-not-allowed';
9
+ const ctx = getContext('ctx') ?? {};
10
+ // single selection
11
+ const selected = ctx.selected ?? writable();
12
+ function init(node) {
13
+ selected.set(node);
14
+ const destroy = selected.subscribe((x) => {
15
+ if (x !== node) {
16
+ open = false;
17
+ }
18
+ });
19
+ return { destroy };
20
+ }
21
+ let buttonClass;
22
+ $: buttonClass = classNames(defaultClass, open ? activeClasses ?? ctx.activeClasses : inactiveClasses ?? ctx.inactiveClasses, open && 'active'
23
+ // $$restProps.disabled && 'cursor-not-allowed pointer-events-none'
24
+ );
25
+ </script>
26
+
27
+ <li class={classNames('group', $$props.class)} role="presentation">
28
+ <button
29
+ type="button"
30
+ on:click={() => (open = true)}
31
+ on:blur
32
+ on:click
33
+ on:focus
34
+ on:keydown
35
+ on:keypress
36
+ on:keyup
37
+ on:mouseenter
38
+ on:mouseleave
39
+ on:mouseover
40
+ role="tab"
41
+ {...$$restProps}
42
+ class={buttonClass}>
43
+ <slot name="title">{title}</slot>
44
+ </button>
45
+
46
+ {#if open}
47
+ <div class="hidden tab_content_placeholder">
48
+ <div use:init>
49
+ <slot />
50
+ </div>
51
+ </div>
52
+ {/if}
53
+ </li>
@@ -0,0 +1,34 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ [x: string]: any;
5
+ open?: boolean | undefined;
6
+ title?: string | undefined;
7
+ activeClasses?: string | undefined;
8
+ inactiveClasses?: string | undefined;
9
+ defaultClass?: string | undefined;
10
+ };
11
+ events: {
12
+ blur: FocusEvent;
13
+ click: MouseEvent;
14
+ focus: FocusEvent;
15
+ keydown: KeyboardEvent;
16
+ keypress: KeyboardEvent;
17
+ keyup: KeyboardEvent;
18
+ mouseenter: MouseEvent;
19
+ mouseleave: MouseEvent;
20
+ mouseover: MouseEvent;
21
+ } & {
22
+ [evt: string]: CustomEvent<any>;
23
+ };
24
+ slots: {
25
+ title: {};
26
+ default: {};
27
+ };
28
+ };
29
+ export declare type TabItemProps = typeof __propDef.props;
30
+ export declare type TabItemEvents = typeof __propDef.events;
31
+ export declare type TabItemSlots = typeof __propDef.slots;
32
+ export default class TabItem extends SvelteComponentTyped<TabItemProps, TabItemEvents, TabItemSlots> {
33
+ }
34
+ export {};
@@ -0,0 +1,50 @@
1
+ <script context="module">import { writable } from 'svelte/store';
2
+ // styles
3
+ const styledActiveClasses = {
4
+ full: 'p-4 w-full group-first:rounded-l-lg group-last:rounded-r-lg text-gray-900 bg-gray-100 focus:ring-4 focus:ring-blue-300 focus:outline-none dark:bg-gray-700 dark:text-white',
5
+ pill: 'py-3 px-4 text-white bg-blue-600 rounded-lg',
6
+ underline: 'p-4 text-blue-600 border-b-2 border-blue-600 dark:text-blue-500 dark:border-blue-500',
7
+ none: ''
8
+ };
9
+ const styledInactiveClasses = {
10
+ full: 'p-4 w-full group-first:rounded-l-lg group-last:rounded-r-lg text-gray-500 dark:text-gray-400 bg-white hover:text-gray-700 hover:bg-gray-50 focus:ring-4 focus:ring-blue-300 focus:outline-none dark:hover:text-white dark:bg-gray-800 dark:hover:bg-gray-700',
11
+ pill: 'py-3 px-4 text-gray-500 rounded-lg hover:text-gray-900 hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-white',
12
+ underline: 'p-4 border-b-2 border-transparent hover:text-gray-600 hover:border-gray-300 dark:hover:text-gray-300 text-gray-500 dark:text-gray-400',
13
+ none: ''
14
+ };
15
+ </script>
16
+
17
+ <script>import classNames from 'classnames';
18
+ import { setContext } from 'svelte';
19
+ export let style = 'none';
20
+ export let defaultClass = 'flex flex-wrap space-x-2';
21
+ export let contentClass = 'p-4 bg-gray-50 rounded-lg dark:bg-gray-800 mt-4';
22
+ export let divider = true;
23
+ export let activeClasses = 'p-4 text-blue-600 bg-gray-100 rounded-t-lg dark:bg-gray-800 dark:text-blue-500';
24
+ export let inactiveClasses = 'p-4 text-gray-500 rounded-t-lg hover:text-gray-600 hover:bg-gray-50 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-gray-300';
25
+ const ctx = {
26
+ activeClasses: styledActiveClasses[style] || activeClasses,
27
+ inactiveClasses: styledInactiveClasses[style] || inactiveClasses,
28
+ selected: writable()
29
+ };
30
+ $: divider = ['full', 'pill'].includes(style) ? false : divider;
31
+ setContext('ctx', ctx);
32
+ function init(node) {
33
+ const destroy = ctx.selected.subscribe((x) => {
34
+ if (x)
35
+ node.replaceChildren(x);
36
+ });
37
+ return { destroy };
38
+ }
39
+ $: ulClass = classNames(defaultClass, style === 'underline' && '-mb-px', $$props.class);
40
+ </script>
41
+
42
+ <ul class={ulClass}>
43
+ <slot {style} />
44
+ </ul>
45
+ {#if divider}
46
+ <slot name="divider">
47
+ <div class="h-px bg-gray-200 dark:bg-gray-700" />
48
+ </slot>
49
+ {/if}
50
+ <div class={contentClass} role="tabpanel" aria-labelledby="id-tab" use:init />
@@ -0,0 +1,33 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ import { type Writable } from 'svelte/store';
3
+ export interface TabCtxType {
4
+ activeClasses: string;
5
+ inactiveClasses: string;
6
+ selected: Writable<HTMLElement>;
7
+ }
8
+ declare const __propDef: {
9
+ props: {
10
+ [x: string]: any;
11
+ style?: "none" | "pill" | "underline" | "full" | undefined;
12
+ defaultClass?: string | undefined;
13
+ contentClass?: string | undefined;
14
+ divider?: boolean | undefined;
15
+ activeClasses?: string | undefined;
16
+ inactiveClasses?: string | undefined;
17
+ };
18
+ events: {
19
+ [evt: string]: CustomEvent<any>;
20
+ };
21
+ slots: {
22
+ default: {
23
+ style: "none" | "pill" | "underline" | "full";
24
+ };
25
+ divider: {};
26
+ };
27
+ };
28
+ export declare type TabsProps = typeof __propDef.props;
29
+ export declare type TabsEvents = typeof __propDef.events;
30
+ export declare type TabsSlots = typeof __propDef.slots;
31
+ export default class Tabs extends SvelteComponentTyped<TabsProps, TabsEvents, TabsSlots> {
32
+ }
33
+ export {};
@@ -71,23 +71,35 @@ const borderColors = {
71
71
  form: 'border-gray-300 dark:border-gray-700',
72
72
  none: ''
73
73
  };
74
- // have a custom transition function that returns the desired transition
75
- let transitionFunc;
76
- $: transitionFunc = transition ?? (() => ({}));
77
74
  let divClass;
78
75
  $: divClass = classNames(bgColors[color], textColors[color], rounded && (color === 'dropdown' ? 'rounded' : 'rounded-lg'), border && 'border', borderColors[color], shadow && 'shadow-md', $$props.class);
79
76
  </script>
80
77
 
81
- <svelte:element
82
- this={tag}
83
- use:use={options}
84
- bind:this={node}
85
- transition:transitionFunc|local={params}
86
- {...$$restProps}
87
- class={divClass}
88
- on:mouseenter
89
- on:mouseleave
90
- on:focusin
91
- on:focusout>
92
- <slot />
93
- </svelte:element>
78
+ {#if transition}
79
+ <svelte:element
80
+ this={tag}
81
+ use:use={options}
82
+ bind:this={node}
83
+ transition:transition={params}
84
+ {...$$restProps}
85
+ class={divClass}
86
+ on:mouseenter
87
+ on:mouseleave
88
+ on:focusin
89
+ on:focusout>
90
+ <slot />
91
+ </svelte:element>
92
+ {:else}
93
+ <svelte:element
94
+ this={tag}
95
+ use:use={options}
96
+ bind:this={node}
97
+ {...$$restProps}
98
+ class={divClass}
99
+ on:mouseenter
100
+ on:mouseleave
101
+ on:focusin
102
+ on:focusout>
103
+ <slot />
104
+ </svelte:element>
105
+ {/if}
@@ -1,10 +0,0 @@
1
- <script>export let activeTabValue;
2
- export let id;
3
- export let contentDivClass = 'p-4 bg-gray-50 rounded-lg dark:bg-gray-800';
4
- </script>
5
-
6
- {#if activeTabValue === id}
7
- <div class={contentDivClass} id="{id}-tabitem" role="tabpanel" aria-labelledby="{id}-tab">
8
- <slot />
9
- </div>
10
- {/if}
@@ -1,20 +0,0 @@
1
- import { SvelteComponentTyped } from "svelte";
2
- declare const __propDef: {
3
- props: {
4
- activeTabValue: number;
5
- id: number;
6
- contentDivClass?: string | undefined;
7
- };
8
- events: {
9
- [evt: string]: CustomEvent<any>;
10
- };
11
- slots: {
12
- default: {};
13
- };
14
- };
15
- export declare type TabContentItemProps = typeof __propDef.props;
16
- export declare type TabContentItemEvents = typeof __propDef.events;
17
- export declare type TabContentItemSlots = typeof __propDef.slots;
18
- export default class TabContentItem extends SvelteComponentTyped<TabContentItemProps, TabContentItemEvents, TabContentItemSlots> {
19
- }
20
- export {};
@@ -1,8 +0,0 @@
1
- <script>import classNames from 'classnames';
2
- export let divClass = 'w-full';
3
- export let tabStyle = 'default';
4
- </script>
5
-
6
- <div class={classNames(divClass, $$props.class)}>
7
- <slot {tabStyle} />
8
- </div>
@@ -1,22 +0,0 @@
1
- import { SvelteComponentTyped } from "svelte";
2
- declare const __propDef: {
3
- props: {
4
- [x: string]: any;
5
- divClass?: string | undefined;
6
- tabStyle?: "default" | "icon" | "custom" | "pill" | "underline" | "full" | undefined;
7
- };
8
- events: {
9
- [evt: string]: CustomEvent<any>;
10
- };
11
- slots: {
12
- default: {
13
- tabStyle: "default" | "icon" | "custom" | "pill" | "underline" | "full";
14
- };
15
- };
16
- };
17
- export declare type TabWrapperProps = typeof __propDef.props;
18
- export declare type TabWrapperEvents = typeof __propDef.events;
19
- export declare type TabWrapperSlots = typeof __propDef.slots;
20
- export default class TabWrapper extends SvelteComponentTyped<TabWrapperProps, TabWrapperEvents, TabWrapperSlots> {
21
- }
22
- export {};