flowbite-svelte 0.26.1 → 0.26.2

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.26.2](https://github.com/themesberg/flowbite-svelte/compare/v0.26.1...v0.26.2) (2022-08-30)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * add icon page ([0f5c966](https://github.com/themesberg/flowbite-svelte/commit/0f5c96626954d4174d10b99f2934365628f2ec08))
11
+ * Iconinput click handler example ([2f5afc7](https://github.com/themesberg/flowbite-svelte/commit/2f5afc7554a7bb43d231cc39001ea31b9deafd1c))
12
+ * remove heros icons from buttons page ([ec81a39](https://github.com/themesberg/flowbite-svelte/commit/ec81a393f438e2285d36ed7fea787af956c6f128))
13
+ * remove heros icons from checkbox page ([1ed983c](https://github.com/themesberg/flowbite-svelte/commit/1ed983c2b230e6309ae6882972176480f8060487))
14
+ * remove old tab components ([a61dd72](https://github.com/themesberg/flowbite-svelte/commit/a61dd728d1eb01bdbfeb61ff3adf8f96d7a1fbde))
15
+ * remove svelte:component from FooterIcon ([0406128](https://github.com/themesberg/flowbite-svelte/commit/04061286046845c7f5c34f56ef89013d4a610aee))
16
+
5
17
  ### [0.26.1](https://github.com/themesberg/flowbite-svelte/compare/v0.26.0...v0.26.1) (2022-08-29)
6
18
 
7
19
 
@@ -2,15 +2,12 @@
2
2
  export let href = '';
3
3
  export let ariaLabel = '';
4
4
  export let aClass = 'text-gray-500 hover:text-gray-900 dark:hover:text-white';
5
- export let icon = null;
6
- export let iconClass = 'h-5 w-5';
7
- export let size = '20';
8
5
  </script>
9
6
 
10
7
  {#if href}
11
8
  <a {href} aria-label={ariaLabel} class={classNames(aClass, $$props.class)}>
12
- <svelte:component this={icon} {size} class={iconClass} />
9
+ <slot />
13
10
  </a>
14
11
  {:else}
15
- <svelte:component this={icon} {size} class={iconClass} />
12
+ <slot />
16
13
  {/if}
@@ -1,19 +1,17 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
- import type { SvelteComponent } from 'svelte';
3
2
  declare const __propDef: {
4
3
  props: {
5
4
  [x: string]: any;
6
5
  href?: string;
7
6
  ariaLabel?: string;
8
7
  aClass?: string;
9
- icon?: typeof SvelteComponent | null;
10
- iconClass?: string;
11
- size?: string;
12
8
  };
13
9
  events: {
14
10
  [evt: string]: CustomEvent<any>;
15
11
  };
16
- slots: {};
12
+ slots: {
13
+ default: {};
14
+ };
17
15
  };
18
16
  export declare type FooterIconProps = typeof __propDef.props;
19
17
  export declare type FooterIconEvents = typeof __propDef.events;
@@ -1,21 +1,17 @@
1
1
  <script>import classNames from 'classnames';
2
- // import type { InputType } from '../types';
3
- // export let type: InputType = 'text';
4
2
  export let value = '';
5
3
  export let size = 'md';
6
- export let icon;
7
4
  export let noBorder = false;
8
5
  export let inputClass = 'rounded-none rounded-r-lg bg-gray-50 border border-gray-300 text-gray-900 focus:ring-blue-500 focus:border-blue-500 block flex-1 min-w-0 w-full border-gray-300 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
6
  export let spanClass = 'inline-flex items-center px-3 text-sm text-gray-900 bg-gray-200 rounded-l-md border border-r-0 border-gray-300 dark:bg-gray-600 dark:text-gray-400 dark:border-gray-600';
10
- 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';
7
+ 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 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';
11
8
  export let pointerEvent = false;
12
9
  export let noBorderDivClass = 'flex absolute inset-y-0 left-0 items-center pl-3';
13
- export let iconClass = 'mr-2';
14
10
  </script>
15
11
 
16
12
  {#if noBorder}
17
13
  <div class="relative">
18
- <span
14
+ <div
19
15
  class={classNames(
20
16
  noBorderDivClass,
21
17
  {
@@ -24,47 +20,27 @@ export let iconClass = 'mr-2';
24
20
  'sm:text-md p-4': size === 'lg'
25
21
  },
26
22
  pointerEvent ? 'cursor-pointer' : 'pointer-events-none'
27
- )}
28
- >
29
- <svelte:component
30
- this={icon}
31
- on:click
32
- size={classNames({
33
- 16: size === 'sm',
34
- 18: size === 'md',
35
- 20: size === 'lg'
36
- })}
37
- class={iconClass}
38
- />
39
- </span>
23
+ )}>
24
+ <slot />
25
+ </div>
40
26
  <input
41
27
  {...$$restProps}
42
28
  bind:value
43
29
  class={classNames(
44
30
  noBorderInputClass,
45
31
  {
46
- 'p-2 sm:text-xs': size === 'sm',
47
- 'p-2.5 text-sm': size === 'md',
48
- 'sm:text-md p-4': size === 'lg'
32
+ 'p-2 sm:text-xs pl-9': size === 'sm',
33
+ 'p-2.5 text-sm pl-10': size === 'md',
34
+ 'sm:text-md p-4 pl-11': size === 'lg'
49
35
  },
50
36
  $$props.class
51
- )}
52
- />
37
+ )} />
53
38
  </div>
54
39
  {:else}
55
40
  <div class="flex">
56
- <div class={spanClass}>
57
- <svelte:component
58
- this={icon}
59
- on:click
60
- size={classNames({
61
- 16: size === 'sm',
62
- 18: size === 'md',
63
- 20: size === 'lg'
64
- })}
65
- class={classNames(iconClass, pointerEvent ? 'cursor-pointer' : 'pointer-events-none')}
66
- />
67
- </div>
41
+ <span class={spanClass}>
42
+ <slot />
43
+ </span>
68
44
  <input
69
45
  {...$$restProps}
70
46
  bind:value
@@ -76,7 +52,6 @@ export let iconClass = 'mr-2';
76
52
  'sm:text-md p-4': size === 'lg'
77
53
  },
78
54
  $$props.class
79
- )}
80
- />
55
+ )} />
81
56
  </div>
82
57
  {/if}
@@ -1,25 +1,22 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
- import type { SvelteComponent } from 'svelte';
3
2
  declare const __propDef: {
4
3
  props: {
5
4
  [x: string]: any;
6
5
  value?: string;
7
6
  size?: 'sm' | 'md' | 'lg';
8
- icon: typeof SvelteComponent;
9
7
  noBorder?: boolean;
10
8
  inputClass?: string;
11
9
  spanClass?: string;
12
10
  noBorderInputClass?: string;
13
11
  pointerEvent?: boolean;
14
12
  noBorderDivClass?: string;
15
- iconClass?: string;
16
13
  };
17
14
  events: {
18
- click: any;
19
- } & {
20
15
  [evt: string]: CustomEvent<any>;
21
16
  };
22
- slots: {};
17
+ slots: {
18
+ default: {};
19
+ };
23
20
  };
24
21
  export declare type IconinputProps = typeof __propDef.props;
25
22
  export declare type IconinputEvents = typeof __propDef.events;
@@ -46,5 +46,4 @@ const setType = (node) => {
46
46
  'sm:text-md p-4': size === 'lg'
47
47
  },
48
48
  $$props.class
49
- )}
50
- />
49
+ )} />
package/index.d.ts CHANGED
@@ -88,16 +88,6 @@ export { default as TableBodyRow } from './tables/TableBodyRow.svelte';
88
88
  export { default as TableHead } from './tables/TableHead.svelte';
89
89
  export { default as TableHeadCell } from './tables/TableHeadCell.svelte';
90
90
  export { default as TableSearch } from './tables/TableSearch.svelte';
91
- export { default as Tabs } from './tabs/Tabs.svelte';
92
- export { tabStore } from './tabs/tabStores.js';
93
- export { default as InteractiveTabHead } from './tabs/InteractiveTabHead.svelte';
94
- export { default as InteractiveTabs } from './tabs/InteractiveTabs.svelte';
95
- export { default as DefaultTabs } from './tabs/DefaultTabs.svelte';
96
- export { default as FullWidthTabs } from './tabs/FullWidthTabs.svelte';
97
- export { default as IconTabs } from './tabs/IconTabs.svelte';
98
- export { default as PillTabs } from './tabs/PillTabs.svelte';
99
- export { default as TabContent } from './tabs/TabContent.svelte';
100
- export { default as UnderlineTabs } from './tabs/UnderlineTabs.svelte';
101
91
  export { default as TabHead } from './tabs/TabHead.svelte';
102
92
  export { default as TabHeadItem } from './tabs/TabHeadItem.svelte';
103
93
  export { default as TabContentItem } from './tabs/TabContentItem.svelte';
package/index.js CHANGED
@@ -116,17 +116,6 @@ export { default as TableHead } from './tables/TableHead.svelte';
116
116
  export { default as TableHeadCell } from './tables/TableHeadCell.svelte';
117
117
  export { default as TableSearch } from './tables/TableSearch.svelte';
118
118
  // Tabs
119
- export { default as Tabs } from './tabs/Tabs.svelte';
120
- export { tabStore } from './tabs/tabStores.js';
121
- export { default as InteractiveTabHead } from './tabs/InteractiveTabHead.svelte';
122
- export { default as InteractiveTabs } from './tabs/InteractiveTabs.svelte';
123
- export { default as DefaultTabs } from './tabs/DefaultTabs.svelte';
124
- export { default as FullWidthTabs } from './tabs/FullWidthTabs.svelte';
125
- export { default as IconTabs } from './tabs/IconTabs.svelte';
126
- export { default as PillTabs } from './tabs/PillTabs.svelte';
127
- export { default as TabContent } from './tabs/TabContent.svelte';
128
- export { default as UnderlineTabs } from './tabs/UnderlineTabs.svelte';
129
- // Tabs new
130
119
  export { default as TabHead } from './tabs/TabHead.svelte';
131
120
  export { default as TabHeadItem } from './tabs/TabHeadItem.svelte';
132
121
  export { default as TabContentItem } from './tabs/TabContentItem.svelte';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flowbite-svelte",
3
- "version": "0.26.1",
3
+ "version": "0.26.2",
4
4
  "description": "Flowbite components for Svelte",
5
5
  "main": "index.js",
6
6
  "author": {
@@ -200,21 +200,11 @@
200
200
  "./tables/TableHead.svelte": "./tables/TableHead.svelte",
201
201
  "./tables/TableHeadCell.svelte": "./tables/TableHeadCell.svelte",
202
202
  "./tables/TableSearch.svelte": "./tables/TableSearch.svelte",
203
- "./tabs/DefaultTabs.svelte": "./tabs/DefaultTabs.svelte",
204
- "./tabs/FullWidthTabs.svelte": "./tabs/FullWidthTabs.svelte",
205
- "./tabs/IconTabs.svelte": "./tabs/IconTabs.svelte",
206
- "./tabs/InteractiveTabHead.svelte": "./tabs/InteractiveTabHead.svelte",
207
- "./tabs/InteractiveTabs.svelte": "./tabs/InteractiveTabs.svelte",
208
- "./tabs/PillTabs.svelte": "./tabs/PillTabs.svelte",
209
- "./tabs/TabContent.svelte": "./tabs/TabContent.svelte",
210
203
  "./tabs/TabContentItem.svelte": "./tabs/TabContentItem.svelte",
211
204
  "./tabs/TabContentWrapper.svelte": "./tabs/TabContentWrapper.svelte",
212
205
  "./tabs/TabHead.svelte": "./tabs/TabHead.svelte",
213
206
  "./tabs/TabHeadItem.svelte": "./tabs/TabHeadItem.svelte",
214
207
  "./tabs/TabWrapper.svelte": "./tabs/TabWrapper.svelte",
215
- "./tabs/Tabs.svelte": "./tabs/Tabs.svelte",
216
- "./tabs/UnderlineTabs.svelte": "./tabs/UnderlineTabs.svelte",
217
- "./tabs/tabStores": "./tabs/tabStores.js",
218
208
  "./timelines/Activity.svelte": "./timelines/Activity.svelte",
219
209
  "./timelines/ActivityItem.svelte": "./timelines/ActivityItem.svelte",
220
210
  "./timelines/Group.svelte": "./timelines/Group.svelte",
@@ -1,9 +1,10 @@
1
1
  <script>import classNames from 'classnames';
2
2
  export let href = '#';
3
3
  export let textColor = 'text-blue-600 dark:text-blue-500';
4
- export let aClass = 'inline-flex items-center text-lg hover:underline';
4
+ export let aClass = 'inline-flex items-center hover:underline';
5
+ export let textSize = 'text-lg';
5
6
  </script>
6
7
 
7
- <a {href} class={classNames(aClass, textColor, $$props.class)}>
8
- <slot />
8
+ <a {href} class={classNames(aClass, textColor, textSize, $$props.class)}>
9
+ <slot />
9
10
  </a>
@@ -5,6 +5,7 @@ declare const __propDef: {
5
5
  href?: string;
6
6
  textColor?: string;
7
7
  aClass?: string;
8
+ textSize?: string;
8
9
  };
9
10
  events: {
10
11
  [evt: string]: CustomEvent<any>;
@@ -1,26 +0,0 @@
1
- <script>export let tabs;
2
- </script>
3
-
4
- <ul class="flex flex-wrap border-b border-gray-200 dark:border-gray-700">
5
- {#each tabs as { name, active, href, rel }}
6
- <li class="mr-2">
7
- <a
8
- {href}
9
- {rel}
10
- aria-current="page"
11
- on:blur
12
- on:click
13
- on:focus
14
- on:keydown
15
- on:keypress
16
- on:keyup
17
- on:mouseenter
18
- on:mouseleave
19
- on:mouseover
20
- class={active
21
- ? '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'
22
- : ' inline-block py-4 px-4 text-sm font-medium text-center 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 '}
23
- >{name}</a
24
- >
25
- </li>{/each}
26
- </ul>
@@ -1,27 +0,0 @@
1
- import { SvelteComponentTyped } from "svelte";
2
- import type { TabType } from '../types';
3
- declare const __propDef: {
4
- props: {
5
- tabs: TabType[];
6
- };
7
- events: {
8
- blur: FocusEvent;
9
- click: MouseEvent;
10
- focus: FocusEvent;
11
- keydown: KeyboardEvent;
12
- keypress: KeyboardEvent;
13
- keyup: KeyboardEvent;
14
- mouseenter: MouseEvent;
15
- mouseleave: MouseEvent;
16
- mouseover: MouseEvent;
17
- } & {
18
- [evt: string]: CustomEvent<any>;
19
- };
20
- slots: {};
21
- };
22
- export declare type DefaultTabsProps = typeof __propDef.props;
23
- export declare type DefaultTabsEvents = typeof __propDef.events;
24
- export declare type DefaultTabsSlots = typeof __propDef.slots;
25
- export default class DefaultTabs extends SvelteComponentTyped<DefaultTabsProps, DefaultTabsEvents, DefaultTabsSlots> {
26
- }
27
- export {};
@@ -1,42 +0,0 @@
1
- <script>export let tabs;
2
- export let tabLabel;
3
- </script>
4
-
5
- <div class="sm:hidden">
6
- <label for="tabs" class="sr-only">{tabLabel}</label>
7
- <select
8
- id="tabs"
9
- class="bg-gray-50 border border-gray-300 text-gray-900 sm: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"
10
- >
11
- {#each tabs as { name }}
12
- <option>{name}</option>
13
- {/each}
14
- </select>
15
- </div>
16
- <ul
17
- class="hidden text-sm font-medium text-center text-gray-500 rounded-lg divide-x divide-gray-200 shadow sm:flex dark:divide-gray-700 dark:text-gray-400"
18
- >
19
- {#each tabs as { name, href, rel, active }, i}
20
- <li class="w-full" data-id={i}>
21
- <a
22
- {href}
23
- {rel}
24
- class:rounded-l-lg={i === 0}
25
- class:rounded-r-lg={i === tabs.length - 1}
26
- class={active
27
- ? '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'
28
- : 'inline-block p-4 w-full 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'}
29
- aria-current="page"
30
- on:blur
31
- on:click
32
- on:focus
33
- on:keydown
34
- on:keypress
35
- on:keyup
36
- on:mouseenter
37
- on:mouseleave
38
- on:mouseover>{name}</a
39
- >
40
- </li>
41
- {/each}
42
- </ul>
@@ -1,28 +0,0 @@
1
- import { SvelteComponentTyped } from "svelte";
2
- import type { TabType } from '../types';
3
- declare const __propDef: {
4
- props: {
5
- tabs: TabType[];
6
- tabLabel: string;
7
- };
8
- events: {
9
- blur: FocusEvent;
10
- click: MouseEvent;
11
- focus: FocusEvent;
12
- keydown: KeyboardEvent;
13
- keypress: KeyboardEvent;
14
- keyup: KeyboardEvent;
15
- mouseenter: MouseEvent;
16
- mouseleave: MouseEvent;
17
- mouseover: MouseEvent;
18
- } & {
19
- [evt: string]: CustomEvent<any>;
20
- };
21
- slots: {};
22
- };
23
- export declare type FullWidthTabsProps = typeof __propDef.props;
24
- export declare type FullWidthTabsEvents = typeof __propDef.events;
25
- export declare type FullWidthTabsSlots = typeof __propDef.slots;
26
- export default class FullWidthTabs extends SvelteComponentTyped<FullWidthTabsProps, FullWidthTabsEvents, FullWidthTabsSlots> {
27
- }
28
- export {};
@@ -1,33 +0,0 @@
1
- <script>export let tabs;
2
- export let iconClass = 'mr-2 w-5 h-5 text-gray-400 group-hover:text-gray-500 dark:text-gray-500 dark:group-hover:text-gray-300';
3
- </script>
4
-
5
- <div class="border-b border-gray-200 dark:border-gray-700">
6
- <ul
7
- class="flex flex-wrap -mb-px text-sm font-medium text-center text-gray-500 dark:text-gray-400"
8
- >
9
- {#each tabs as { name, active, href, rel, icon, iconSize }}
10
- <li class="mr-2">
11
- <a
12
- {href}
13
- {rel}
14
- class={active
15
- ? 'inline-flex p-4 text-blue-600 rounded-t-lg border-b-2 border-blue-600 active dark:text-blue-500 dark:border-blue-500 group'
16
- : ' inline-flex p-4 rounded-t-lg border-b-2 border-transparent hover:text-gray-600 hover:border-gray-300 dark:hover:text-gray-300 group '}
17
- on:blur
18
- on:click
19
- on:focus
20
- on:keydown
21
- on:keypress
22
- on:keyup
23
- on:mouseenter
24
- on:mouseleave
25
- on:mouseover
26
- >
27
- <svelte:component this={icon} size={iconSize} class={iconClass} />
28
- {name}
29
- </a>
30
- </li>
31
- {/each}
32
- </ul>
33
- </div>
@@ -1,28 +0,0 @@
1
- import { SvelteComponentTyped } from "svelte";
2
- import type { IconTabType } from '../types';
3
- declare const __propDef: {
4
- props: {
5
- tabs: IconTabType[];
6
- iconClass?: string;
7
- };
8
- events: {
9
- blur: FocusEvent;
10
- click: MouseEvent;
11
- focus: FocusEvent;
12
- keydown: KeyboardEvent;
13
- keypress: KeyboardEvent;
14
- keyup: KeyboardEvent;
15
- mouseenter: MouseEvent;
16
- mouseleave: MouseEvent;
17
- mouseover: MouseEvent;
18
- } & {
19
- [evt: string]: CustomEvent<any>;
20
- };
21
- slots: {};
22
- };
23
- export declare type IconTabsProps = typeof __propDef.props;
24
- export declare type IconTabsEvents = typeof __propDef.events;
25
- export declare type IconTabsSlots = typeof __propDef.slots;
26
- export default class IconTabs extends SvelteComponentTyped<IconTabsProps, IconTabsEvents, IconTabsSlots> {
27
- }
28
- export {};
@@ -1,65 +0,0 @@
1
- <script>import { tabStore } from './tabStores';
2
- import classNames from 'classnames';
3
- export let tabs;
4
- export let tabId = 'myTab';
5
- export let activeTabValue = 1;
6
- export let disabled = false;
7
- export let divClass = 'mb-4 border-b border-gray-200';
8
- export let ulClass = 'flex flex-wrap -mb-px text-sm font-medium text-center';
9
- export let liClass = 'mr-2';
10
- export let btnClass = 'inline-block py-4 px-4 text-sm font-medium text-center rounded-t-lg border-b-2 border-transparent';
11
- export let activeClass = 'text-blue-600 hover:text-blue-600 dark:text-blue-500 dark:hover:text-blue-400 border-blue-600 dark:border-blue-500';
12
- export let inactiveClasses = 'text-gray-500 hover:text-gray-600 dark:text-gray-400 border-gray-100 hover:border-gray-300 dark:border-gray-700 dark:hover:text-gray-300';
13
- const handleClick = (tabValue) => () => {
14
- tabStore.update((n) => (n = tabValue));
15
- activeTabValue = tabValue;
16
- };
17
- </script>
18
-
19
- <!--
20
- @component
21
- Header part of Interactive tab component. Use with TabContent.
22
-
23
- @param tabs: TabHeadType[];
24
- @param tabId = 'myTab';
25
-
26
- - Usage:
27
-
28
- ```tsx
29
- <InteractiveHead>
30
- <TabContent>
31
- Some HTML|Component|string
32
- </TabContent>
33
- </InteractiveHead>
34
- ```
35
- -->
36
- <div class={divClass}>
37
- <ul class={ulClass} id={tabId} data-tabs-toggle="#myTabContent" role="tablist">
38
- {#each tabs as { name, id }}
39
- <li class={liClass} role="presentation">
40
- <button
41
- on:click={handleClick(id)}
42
- class={classNames(btnClass, activeTabValue === id ? activeClass : inactiveClasses)}
43
- id="{name}-tab"
44
- data-tabs-target="#{name}"
45
- type="button"
46
- role="tab"
47
- aria-controls={name}
48
- aria-selected="false"
49
- on:blur
50
- on:click
51
- on:focus
52
- on:keydown
53
- on:keypress
54
- on:keyup
55
- on:mouseenter
56
- on:mouseleave
57
- on:mouseover
58
- {disabled}>{name}</button
59
- >
60
- </li>
61
- {/each}
62
- </ul>
63
- </div>
64
-
65
- <slot />
@@ -1,54 +0,0 @@
1
- import { SvelteComponentTyped } from "svelte";
2
- import type { TabHeadType } from '../types';
3
- declare const __propDef: {
4
- props: {
5
- tabs: TabHeadType[];
6
- tabId?: string;
7
- activeTabValue?: number;
8
- disabled?: boolean;
9
- divClass?: string;
10
- ulClass?: string;
11
- liClass?: string;
12
- btnClass?: string;
13
- activeClass?: string;
14
- inactiveClasses?: string;
15
- };
16
- events: {
17
- blur: FocusEvent;
18
- click: MouseEvent;
19
- focus: FocusEvent;
20
- keydown: KeyboardEvent;
21
- keypress: KeyboardEvent;
22
- keyup: KeyboardEvent;
23
- mouseenter: MouseEvent;
24
- mouseleave: MouseEvent;
25
- mouseover: MouseEvent;
26
- } & {
27
- [evt: string]: CustomEvent<any>;
28
- };
29
- slots: {
30
- default: {};
31
- };
32
- };
33
- export declare type InteractiveTabHeadProps = typeof __propDef.props;
34
- export declare type InteractiveTabHeadEvents = typeof __propDef.events;
35
- export declare type InteractiveTabHeadSlots = typeof __propDef.slots;
36
- /**
37
- * Header part of Interactive tab component. Use with TabContent.
38
- *
39
- * @param tabs: TabHeadType[];
40
- * @param tabId = 'myTab';
41
- *
42
- * - Usage:
43
- *
44
- * ```tsx
45
- * <InteractiveHead>
46
- * <TabContent>
47
- * Some HTML|Component|string
48
- * </TabContent>
49
- * </InteractiveHead>
50
- * ```
51
- */
52
- export default class InteractiveTabHead extends SvelteComponentTyped<InteractiveTabHeadProps, InteractiveTabHeadEvents, InteractiveTabHeadSlots> {
53
- }
54
- export {};
@@ -1,56 +0,0 @@
1
- <script>import classNames from 'classnames';
2
- export let tabId = 'myTab';
3
- export let activeTabValue = 1;
4
- export let tabs;
5
- export let btnClass = 'inline-block py-4 px-4 text-sm font-medium text-center rounded-t-lg border-b-2 border-transparent';
6
- export let activeClass = 'text-blue-600 hover:text-blue-600 dark:text-blue-500 dark:hover:text-blue-400 border-blue-600 dark:border-blue-500';
7
- export let inactiveClasses = 'text-gray-500 hover:text-gray-600 dark:text-gray-400 border-gray-100 hover:border-gray-300 dark:border-gray-700 dark:hover:text-gray-300';
8
- const handleClick = (tabValue) => () => (activeTabValue = tabValue);
9
- </script>
10
-
11
- <div class="mb-4 border-b border-gray-200 dark:border-gray-700">
12
- <ul class="flex flex-wrap -mb-px" id={tabId} role="tablist">
13
- {#each tabs as { name, id, disabled }}
14
- <li class="mr-2" role="presentation">
15
- <button
16
- on:click={handleClick(id)}
17
- on:blur
18
- on:click
19
- on:focus
20
- on:keydown
21
- on:keypress
22
- on:keyup
23
- on:mouseenter
24
- on:mouseleave
25
- on:mouseover
26
- class={classNames(btnClass, activeTabValue === id ? activeClass : inactiveClasses)}
27
- id="{name}-tab"
28
- type="button"
29
- role="tab"
30
- aria-controls={name}
31
- {disabled}>{name}</button
32
- >
33
- </li>
34
- {/each}
35
- </ul>
36
- </div>
37
- <div id="{tabId}Content">
38
- {#each tabs as { name, content, id }}
39
- {#if activeTabValue === id}
40
- <div
41
- class="p-4 bg-gray-50 rounded-lg dark:bg-gray-800"
42
- id={name}
43
- role="tabpanel"
44
- aria-labelledby="{name}-tab"
45
- >
46
- {#if typeof content === 'string'}
47
- <p class="text-sm text-gray-500 dark:text-gray-400">
48
- {@html content}
49
- </p>
50
- {:else}
51
- <svelte:component this={content} />
52
- {/if}
53
- </div>
54
- {/if}
55
- {/each}
56
- </div>
@@ -1,32 +0,0 @@
1
- import { SvelteComponentTyped } from "svelte";
2
- import type { InteractiveTabType } from '../types';
3
- declare const __propDef: {
4
- props: {
5
- tabId?: string;
6
- activeTabValue?: number;
7
- tabs: InteractiveTabType[];
8
- btnClass?: string;
9
- activeClass?: string;
10
- inactiveClasses?: string;
11
- };
12
- events: {
13
- blur: FocusEvent;
14
- click: MouseEvent;
15
- focus: FocusEvent;
16
- keydown: KeyboardEvent;
17
- keypress: KeyboardEvent;
18
- keyup: KeyboardEvent;
19
- mouseenter: MouseEvent;
20
- mouseleave: MouseEvent;
21
- mouseover: MouseEvent;
22
- } & {
23
- [evt: string]: CustomEvent<any>;
24
- };
25
- slots: {};
26
- };
27
- export declare type InteractiveTabsProps = typeof __propDef.props;
28
- export declare type InteractiveTabsEvents = typeof __propDef.events;
29
- export declare type InteractiveTabsSlots = typeof __propDef.slots;
30
- export default class InteractiveTabs extends SvelteComponentTyped<InteractiveTabsProps, InteractiveTabsEvents, InteractiveTabsSlots> {
31
- }
32
- export {};
@@ -1,25 +0,0 @@
1
- <script>export let tabs;
2
- </script>
3
-
4
- <ul class="flex flex-wrap">
5
- {#each tabs as { name, selected, href }}
6
- <li class="mr-2">
7
- <a
8
- class="{selected
9
- ? 'active inline-block py-3 px-4 text-sm font-medium text-center text-white bg-blue-600 rounded-lg'
10
- : 'inline-block py-3 px-4 text-sm font-medium text-center 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'} "
11
- {href}
12
- rel="external"
13
- on:blur
14
- on:click
15
- on:focus
16
- on:keydown
17
- on:keypress
18
- on:keyup
19
- on:mouseenter
20
- on:mouseleave
21
- on:mouseover>{name}</a
22
- >
23
- </li>
24
- {/each}
25
- </ul>
@@ -1,27 +0,0 @@
1
- import { SvelteComponentTyped } from "svelte";
2
- import type { PillTabType } from '../types';
3
- declare const __propDef: {
4
- props: {
5
- tabs: PillTabType[];
6
- };
7
- events: {
8
- blur: FocusEvent;
9
- click: MouseEvent;
10
- focus: FocusEvent;
11
- keydown: KeyboardEvent;
12
- keypress: KeyboardEvent;
13
- keyup: KeyboardEvent;
14
- mouseenter: MouseEvent;
15
- mouseleave: MouseEvent;
16
- mouseover: MouseEvent;
17
- } & {
18
- [evt: string]: CustomEvent<any>;
19
- };
20
- slots: {};
21
- };
22
- export declare type PillTabsProps = typeof __propDef.props;
23
- export declare type PillTabsEvents = typeof __propDef.events;
24
- export declare type PillTabsSlots = typeof __propDef.slots;
25
- export default class PillTabs extends SvelteComponentTyped<PillTabsProps, PillTabsEvents, PillTabsSlots> {
26
- }
27
- export {};
@@ -1,32 +0,0 @@
1
- <script>import { tabStore } from './tabStores';
2
- export let divClass = 'p-4 rounded-lg dark:bg-gray-800';
3
- export let tab;
4
- let activeTabValue;
5
- tabStore.subscribe((value) => {
6
- activeTabValue = value;
7
- });
8
- </script>
9
-
10
- <!--
11
- @component
12
- Content part of Interactive tab component. Use with InteractiveHead.
13
-
14
- - let tabId = 'myTab';
15
- - let tabs: TabHeadType;
16
- - let divClass: string;
17
- - Usage:
18
-
19
- ```tsx
20
- <InteractiveHead>
21
- <TabContent>
22
- Some HTML|Component|string
23
- </TabContent>
24
- </InteractiveHead>
25
- ```
26
- -->
27
-
28
- {#if activeTabValue === tab.id}
29
- <div class={divClass} id="{tab.id}Content" role="tabpanel" aria-labelledby="{tab.name}-tab">
30
- <slot />
31
- </div>
32
- {/if}
@@ -1,36 +0,0 @@
1
- import { SvelteComponentTyped } from "svelte";
2
- import type { TabHeadType } from '../types';
3
- declare const __propDef: {
4
- props: {
5
- divClass?: string;
6
- tab: TabHeadType;
7
- };
8
- events: {
9
- [evt: string]: CustomEvent<any>;
10
- };
11
- slots: {
12
- default: {};
13
- };
14
- };
15
- export declare type TabContentProps = typeof __propDef.props;
16
- export declare type TabContentEvents = typeof __propDef.events;
17
- export declare type TabContentSlots = typeof __propDef.slots;
18
- /**
19
- * Content part of Interactive tab component. Use with InteractiveHead.
20
- *
21
- * - let tabId = 'myTab';
22
- * - let tabs: TabHeadType;
23
- * - let divClass: string;
24
- * - Usage:
25
- *
26
- * ```tsx
27
- * <InteractiveHead>
28
- * <TabContent>
29
- * Some HTML|Component|string
30
- * </TabContent>
31
- * </InteractiveHead>
32
- * ```
33
- */
34
- export default class TabContent extends SvelteComponentTyped<TabContentProps, TabContentEvents, TabContentSlots> {
35
- }
36
- export {};
package/tabs/Tabs.svelte DELETED
@@ -1,113 +0,0 @@
1
- <script>import classNames from 'classnames';
2
- export let tabStyle = 'default';
3
- export let tabId = 'myTab';
4
- export let tabLabel = 'Full-width tabs';
5
- export let activeTabValue = 1;
6
- export let tabs;
7
- export let customDivClass = '';
8
- export let customUlClass = '';
9
- export let customLiClass = '';
10
- export let customActiveClass = '';
11
- export let customInActiveClass = '';
12
- export let iconClass = 'mr-2 w-5 h-5 text-gray-400 group-hover:text-gray-500 dark:text-gray-500 dark:group-hover:text-gray-300';
13
- export let contentDivClass = 'p-4 bg-gray-50 rounded-lg dark:bg-gray-800';
14
- export let fullSelectClass = 'bg-gray-50 border border-gray-300 text-gray-900 sm: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';
15
- const divClasses = {
16
- default: 'mb-4 border-b border-gray-200 dark:border-gray-700',
17
- full: 'mb-4',
18
- icon: 'mb-4 border-b border-gray-200 dark:border-gray-700',
19
- pill: 'mb-4 ',
20
- 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',
21
- custom: customDivClass
22
- };
23
- const ulClasses = {
24
- default: 'flex flex-wrap -mb-px',
25
- full: 'hidden text-sm font-medium text-center text-gray-500 rounded-lg divide-x divide-gray-200 shadow sm:flex dark:divide-gray-700 dark:text-gray-400 mb-1',
26
- icon: 'flex flex-wrap -mb-px text-sm font-medium text-center text-gray-500 dark:text-gray-400',
27
- pill: 'flex flex-wrap',
28
- underline: 'flex flex-wrap -mb-px',
29
- custom: customUlClass
30
- };
31
- const liClasses = {
32
- default: 'mr-2',
33
- full: 'w-full',
34
- icon: 'mr-2',
35
- pill: 'mr-2',
36
- underline: 'mr-2',
37
- custom: customLiClass
38
- };
39
- const activeClasses = {
40
- 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',
41
- 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',
42
- icon: 'inline-flex p-4 text-blue-600 rounded-t-lg border-b-2 border-blue-600 active dark:text-blue-500 dark:border-blue-500 group',
43
- pill: 'active inline-block py-3 px-4 text-sm font-medium text-center text-white bg-blue-600 rounded-lg',
44
- underline: 'inline-block p-4 text-blue-600 rounded-t-lg border-b-2 border-blue-600 active dark:text-blue-500 dark:border-blue-500',
45
- custom: customActiveClass
46
- };
47
- const inactiveClasses = {
48
- default: 'inline-block py-4 px-4 text-sm font-medium text-center 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',
49
- full: 'inline-block p-4 w-full 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',
50
- icon: 'inline-flex p-4 rounded-t-lg border-b-2 border-transparent hover:text-gray-600 hover:border-gray-300 dark:hover:text-gray-300 group ',
51
- pill: 'inline-block py-3 px-4 text-sm font-medium text-center 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',
52
- underline: 'inline-block p-4 rounded-t-lg border-b-2 border-transparent hover:text-gray-600 hover:border-gray-300 dark:hover:text-gray-300',
53
- custom: customInActiveClass
54
- };
55
- const handleClick = (tabValue) => () => (activeTabValue = tabValue);
56
- </script>
57
-
58
- {#if tabStyle === 'full'}
59
- <div class="sm:hidden">
60
- <label for="tabs" class="sr-only">{tabLabel}</label>
61
- <select id="tabs" class={fullSelectClass}>
62
- {#each tabs as { name }}
63
- <option>{name}</option>
64
- {/each}
65
- </select>
66
- </div>
67
- {/if}
68
- <div class={divClasses[tabStyle]}>
69
- <ul class={ulClasses[tabStyle]} id={tabId} role="tablist">
70
- {#each tabs as { name, id, disabled, icon, iconSize }}
71
- <li class={liClasses[tabStyle]} role="presentation">
72
- <button
73
- on:click={handleClick(id)}
74
- on:blur
75
- on:click
76
- on:focus
77
- on:keydown
78
- on:keypress
79
- on:keyup
80
- on:mouseenter
81
- on:mouseleave
82
- on:mouseover
83
- class={classNames(
84
- activeTabValue === id ? activeClasses[tabStyle] : inactiveClasses[tabStyle]
85
- )}
86
- id="{name}-tab"
87
- type="button"
88
- role="tab"
89
- aria-controls={name}
90
- {disabled}>
91
- {#if icon}
92
- <svelte:component this={icon} size={iconSize} class={iconClass} />
93
- {/if}
94
- {name}</button>
95
- </li>
96
- {/each}
97
- </ul>
98
- </div>
99
- <div id="{tabId}Content">
100
- {#each tabs as { name, content, id }}
101
- {#if activeTabValue === id}
102
- <div class={contentDivClass} id={name} role="tabpanel" aria-labelledby="{name}-tab">
103
- {#if typeof content === 'string'}
104
- <p class="text-sm text-gray-500 dark:text-gray-400">
105
- {@html content}
106
- </p>
107
- {:else}
108
- <svelte:component this={content} />
109
- {/if}
110
- </div>
111
- {/if}
112
- {/each}
113
- </div>
@@ -1,39 +0,0 @@
1
- import { SvelteComponentTyped } from "svelte";
2
- import type { InteractiveTabType } from '../types';
3
- declare const __propDef: {
4
- props: {
5
- tabStyle?: 'default' | 'full' | 'icon' | 'pill' | 'underline' | 'custom';
6
- tabId?: string;
7
- tabLabel?: string;
8
- activeTabValue?: number;
9
- tabs: InteractiveTabType[];
10
- customDivClass?: string;
11
- customUlClass?: string;
12
- customLiClass?: string;
13
- customActiveClass?: string;
14
- customInActiveClass?: string;
15
- iconClass?: string;
16
- contentDivClass?: string;
17
- fullSelectClass?: string;
18
- };
19
- events: {
20
- blur: FocusEvent;
21
- click: MouseEvent;
22
- focus: FocusEvent;
23
- keydown: KeyboardEvent;
24
- keypress: KeyboardEvent;
25
- keyup: KeyboardEvent;
26
- mouseenter: MouseEvent;
27
- mouseleave: MouseEvent;
28
- mouseover: MouseEvent;
29
- } & {
30
- [evt: string]: CustomEvent<any>;
31
- };
32
- slots: {};
33
- };
34
- export declare type TabsProps = typeof __propDef.props;
35
- export declare type TabsEvents = typeof __propDef.events;
36
- export declare type TabsSlots = typeof __propDef.slots;
37
- export default class Tabs extends SvelteComponentTyped<TabsProps, TabsEvents, TabsSlots> {
38
- }
39
- export {};
@@ -1,28 +0,0 @@
1
- <script>export let divClass = 'text-sm font-medium text-center text-gray-500 border-b border-gray-200 dark:text-gray-400 dark:border-gray-700';
2
- export let tabs;
3
- </script>
4
-
5
- <div class={divClass}>
6
- <ul class="flex flex-wrap -mb-px">
7
- {#each tabs as { name, active, href, rel }}
8
- <li class="mr-2">
9
- <a
10
- {href}
11
- {rel}
12
- on:click
13
- on:change
14
- on:keydown
15
- on:keyup
16
- on:focus
17
- on:blur
18
- on:mouseenter
19
- on:mouseleave
20
- class={active
21
- ? 'inline-block p-4 text-blue-600 rounded-t-lg border-b-2 border-blue-600 active dark:text-blue-500 dark:border-blue-500'
22
- : ' inline-block p-4 rounded-t-lg border-b-2 border-transparent hover:text-gray-600 hover:border-gray-300 dark:hover:text-gray-300 '}
23
- >{name}</a
24
- >
25
- </li>
26
- {/each}
27
- </ul>
28
- </div>
@@ -1,27 +0,0 @@
1
- import { SvelteComponentTyped } from "svelte";
2
- import type { TabType } from '../types';
3
- declare const __propDef: {
4
- props: {
5
- divClass?: string;
6
- tabs: TabType[];
7
- };
8
- events: {
9
- click: MouseEvent;
10
- change: Event;
11
- keydown: KeyboardEvent;
12
- keyup: KeyboardEvent;
13
- focus: FocusEvent;
14
- blur: FocusEvent;
15
- mouseenter: MouseEvent;
16
- mouseleave: MouseEvent;
17
- } & {
18
- [evt: string]: CustomEvent<any>;
19
- };
20
- slots: {};
21
- };
22
- export declare type UnderlineTabsProps = typeof __propDef.props;
23
- export declare type UnderlineTabsEvents = typeof __propDef.events;
24
- export declare type UnderlineTabsSlots = typeof __propDef.slots;
25
- export default class UnderlineTabs extends SvelteComponentTyped<UnderlineTabsProps, UnderlineTabsEvents, UnderlineTabsSlots> {
26
- }
27
- export {};
package/tabs/tabStores.js DELETED
@@ -1,3 +0,0 @@
1
- import { writable } from 'svelte/store';
2
-
3
- export const tabStore = writable(1);