flowbite-svelte 0.24.10 → 0.24.13

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.24.13](https://github.com/themesberg/flowbite-svelte/compare/v0.24.12...v0.24.13) (2022-08-16)
6
+
7
+
8
+ ### Features
9
+
10
+ * add disabled to InteractiveTabs ([f5ca0fe](https://github.com/themesberg/flowbite-svelte/commit/f5ca0fe858a50ef2c017ed6ec266c0012166b5f9))
11
+ * add Tabs component for all tab ([758e2e7](https://github.com/themesberg/flowbite-svelte/commit/758e2e743eb845c7190a7c6c2a9888c67c46db73))
12
+
13
+ ### [0.24.12](https://github.com/themesberg/flowbite-svelte/compare/v0.24.11...v0.24.12) (2022-08-16)
14
+
15
+
16
+ ### Features
17
+
18
+ * add active color to InteractiveTabs and InteractiveTabHead component ([7995e21](https://github.com/themesberg/flowbite-svelte/commit/7995e210f98325350b055a43199fa4d7750ea225))
19
+
20
+ ### [0.24.11](https://github.com/themesberg/flowbite-svelte/compare/v0.24.10...v0.24.11) (2022-08-15)
21
+
22
+
23
+ ### Features
24
+
25
+ * add sticky footer, add $$props.class to all skeleton components ([1fad8dc](https://github.com/themesberg/flowbite-svelte/commit/1fad8dc9d8c0bc1428daeada82f44accc5f7e9a0))
26
+
5
27
  ### [0.24.10](https://github.com/themesberg/flowbite-svelte/compare/v0.24.9...v0.24.10) (2022-08-15)
6
28
 
7
29
 
@@ -1,5 +1,5 @@
1
1
  <script>import classNames from 'classnames';
2
- export let spanClass = 'text-sm text-gray-500 sm:text-center dark:text-gray-400';
2
+ export let spanClass = 'block text-sm text-gray-500 sm:text-center dark:text-gray-400';
3
3
  export let aClass = 'hover:underline';
4
4
  export let year = new Date().getFullYear();
5
5
  export let href = '';
package/index.d.ts CHANGED
@@ -89,6 +89,7 @@ export { default as TableBodyRow } from './tables/TableBodyRow.svelte';
89
89
  export { default as TableHead } from './tables/TableHead.svelte';
90
90
  export { default as TableHeadCell } from './tables/TableHeadCell.svelte';
91
91
  export { default as TableSearch } from './tables/TableSearch.svelte';
92
+ export { default as Tabs } from './tabs/Tabs.svelte';
92
93
  export { tabStore } from './tabs/tabStores.js';
93
94
  export { default as InteractiveTabHead } from './tabs/InteractiveTabHead.svelte';
94
95
  export { default as InteractiveTabs } from './tabs/InteractiveTabs.svelte';
package/index.js CHANGED
@@ -117,6 +117,7 @@ export { default as TableHead } from './tables/TableHead.svelte';
117
117
  export { default as TableHeadCell } from './tables/TableHeadCell.svelte';
118
118
  export { default as TableSearch } from './tables/TableSearch.svelte';
119
119
  // Tabs
120
+ export { default as Tabs } from './tabs/Tabs.svelte';
120
121
  export { tabStore } from './tabs/tabStores.js';
121
122
  export { default as InteractiveTabHead } from './tabs/InteractiveTabHead.svelte';
122
123
  export { default as InteractiveTabs } from './tabs/InteractiveTabs.svelte';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flowbite-svelte",
3
- "version": "0.24.10",
3
+ "version": "0.24.13",
4
4
  "description": "Flowbite components for Svelte",
5
5
  "main": "index.js",
6
6
  "author": {
@@ -204,6 +204,7 @@
204
204
  "./tabs/InteractiveTabs.svelte": "./tabs/InteractiveTabs.svelte",
205
205
  "./tabs/PillTabs.svelte": "./tabs/PillTabs.svelte",
206
206
  "./tabs/TabContent.svelte": "./tabs/TabContent.svelte",
207
+ "./tabs/Tabs.svelte": "./tabs/Tabs.svelte",
207
208
  "./tabs/UnderlineTabs.svelte": "./tabs/UnderlineTabs.svelte",
208
209
  "./tabs/tabStores": "./tabs/tabStores.js",
209
210
  "./timelines/Activity.svelte": "./timelines/Activity.svelte",
@@ -1,10 +1,9 @@
1
- <script>export let size = '48';
1
+ <script>import classNames from 'classnames';
2
+ export let divClass = 'p-4 max-w-sm rounded border border-gray-200 shadow animate-pulse md:p-6 dark:border-gray-700';
3
+ export let size = '48';
2
4
  </script>
3
5
 
4
- <div
5
- role="status"
6
- class="p-4 max-w-sm rounded border border-gray-200 shadow animate-pulse md:p-6 dark:border-gray-700"
7
- >
6
+ <div role="status" class={classNames(divClass, $$props.class)}>
8
7
  <div class="flex justify-center items-center mb-4 h-48 bg-gray-300 rounded dark:bg-gray-700">
9
8
  <svg
10
9
  width={size}
@@ -1,6 +1,8 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
2
  declare const __propDef: {
3
3
  props: {
4
+ [x: string]: any;
5
+ divClass?: string;
4
6
  size?: string;
5
7
  };
6
8
  events: {
@@ -1,10 +1,9 @@
1
- <script>export let size = '48';
1
+ <script>import classNames from 'classnames';
2
+ export let divClass = 'space-y-8 animate-pulse md:space-y-0 md:space-x-8 md:flex md:items-center';
3
+ export let size = '48';
2
4
  </script>
3
5
 
4
- <div
5
- role="status"
6
- class="space-y-8 animate-pulse md:space-y-0 md:space-x-8 md:flex md:items-center"
7
- >
6
+ <div role="status" class={classNames(divClass, $$props.class)}>
8
7
  <div
9
8
  class="flex justify-center items-center w-full h-48 bg-gray-300 rounded sm:w-96 dark:bg-gray-700"
10
9
  >
@@ -1,6 +1,8 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
2
  declare const __propDef: {
3
3
  props: {
4
+ [x: string]: any;
5
+ divClass?: string;
4
6
  size?: string;
5
7
  };
6
8
  events: {
@@ -1,7 +1,8 @@
1
- <div
2
- role="status"
3
- class="p-4 space-y-4 max-w-md rounded border border-gray-200 divide-y divide-gray-200 shadow animate-pulse dark:divide-gray-700 md:p-6 dark:border-gray-700"
4
- >
1
+ <script>import classNames from 'classnames';
2
+ export let divClass = 'p-4 space-y-4 max-w-md rounded border border-gray-200 divide-y divide-gray-200 shadow animate-pulse dark:divide-gray-700 md:p-6 dark:border-gray-700';
3
+ </script>
4
+
5
+ <div role="status" class={classNames(divClass, $$props.class)}>
5
6
  <div class="flex justify-between items-center">
6
7
  <div>
7
8
  <div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-600 w-24 mb-2.5" />
@@ -1,19 +1,17 @@
1
- /** @typedef {typeof __propDef.props} ListPlaceholderProps */
2
- /** @typedef {typeof __propDef.events} ListPlaceholderEvents */
3
- /** @typedef {typeof __propDef.slots} ListPlaceholderSlots */
4
- export default class ListPlaceholder extends SvelteComponentTyped<{}, {
5
- [evt: string]: CustomEvent<any>;
6
- }, {}> {
7
- }
8
- export type ListPlaceholderProps = typeof __propDef.props;
9
- export type ListPlaceholderEvents = typeof __propDef.events;
10
- export type ListPlaceholderSlots = typeof __propDef.slots;
11
1
  import { SvelteComponentTyped } from "svelte";
12
2
  declare const __propDef: {
13
- props: {};
3
+ props: {
4
+ [x: string]: any;
5
+ divClass?: string;
6
+ };
14
7
  events: {
15
8
  [evt: string]: CustomEvent<any>;
16
9
  };
17
10
  slots: {};
18
11
  };
12
+ export declare type ListPlaceholderProps = typeof __propDef.props;
13
+ export declare type ListPlaceholderEvents = typeof __propDef.events;
14
+ export declare type ListPlaceholderSlots = typeof __propDef.slots;
15
+ export default class ListPlaceholder extends SvelteComponentTyped<ListPlaceholderProps, ListPlaceholderEvents, ListPlaceholderSlots> {
16
+ }
19
17
  export {};
@@ -1,4 +1,8 @@
1
- <div role="status" class="max-w-sm animate-pulse">
1
+ <script>import classNames from 'classnames';
2
+ export let divClass = 'max-w-sm animate-pulse';
3
+ </script>
4
+
5
+ <div role="status" class={classNames(divClass, $$props.class)}>
2
6
  <div class="h-2.5 bg-gray-200 rounded-full dark:bg-gray-700 w-48 mb-4" />
3
7
  <div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[360px] mb-2.5" />
4
8
  <div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 mb-2.5" />
@@ -1,19 +1,17 @@
1
- /** @typedef {typeof __propDef.props} SkeletonProps */
2
- /** @typedef {typeof __propDef.events} SkeletonEvents */
3
- /** @typedef {typeof __propDef.slots} SkeletonSlots */
4
- export default class Skeleton extends SvelteComponentTyped<{}, {
5
- [evt: string]: CustomEvent<any>;
6
- }, {}> {
7
- }
8
- export type SkeletonProps = typeof __propDef.props;
9
- export type SkeletonEvents = typeof __propDef.events;
10
- export type SkeletonSlots = typeof __propDef.slots;
11
1
  import { SvelteComponentTyped } from "svelte";
12
2
  declare const __propDef: {
13
- props: {};
3
+ props: {
4
+ [x: string]: any;
5
+ divClass?: string;
6
+ };
14
7
  events: {
15
8
  [evt: string]: CustomEvent<any>;
16
9
  };
17
10
  slots: {};
18
11
  };
12
+ export declare type SkeletonProps = typeof __propDef.props;
13
+ export declare type SkeletonEvents = typeof __propDef.events;
14
+ export declare type SkeletonSlots = typeof __propDef.slots;
15
+ export default class Skeleton extends SvelteComponentTyped<SkeletonProps, SkeletonEvents, SkeletonSlots> {
16
+ }
19
17
  export {};
@@ -1,4 +1,8 @@
1
- <div role="status" class="animate-pulse">
1
+ <script>import classNames from 'classnames';
2
+ export let divClass = 'animate-pulse';
3
+ </script>
4
+
5
+ <div role="status" class={classNames(divClass, $$props.class)}>
2
6
  <div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-700 max-w-[640px] mb-2.5 mx-auto" />
3
7
  <div class="h-2.5 mx-auto bg-gray-300 rounded-full dark:bg-gray-700 max-w-[540px]" />
4
8
  <div class="flex justify-center items-center mt-4">
@@ -1,19 +1,17 @@
1
- /** @typedef {typeof __propDef.props} TestimonialPlaceholderProps */
2
- /** @typedef {typeof __propDef.events} TestimonialPlaceholderEvents */
3
- /** @typedef {typeof __propDef.slots} TestimonialPlaceholderSlots */
4
- export default class TestimonialPlaceholder extends SvelteComponentTyped<{}, {
5
- [evt: string]: CustomEvent<any>;
6
- }, {}> {
7
- }
8
- export type TestimonialPlaceholderProps = typeof __propDef.props;
9
- export type TestimonialPlaceholderEvents = typeof __propDef.events;
10
- export type TestimonialPlaceholderSlots = typeof __propDef.slots;
11
1
  import { SvelteComponentTyped } from "svelte";
12
2
  declare const __propDef: {
13
- props: {};
3
+ props: {
4
+ [x: string]: any;
5
+ divClass?: string;
6
+ };
14
7
  events: {
15
8
  [evt: string]: CustomEvent<any>;
16
9
  };
17
10
  slots: {};
18
11
  };
12
+ export declare type TestimonialPlaceholderProps = typeof __propDef.props;
13
+ export declare type TestimonialPlaceholderEvents = typeof __propDef.events;
14
+ export declare type TestimonialPlaceholderSlots = typeof __propDef.slots;
15
+ export default class TestimonialPlaceholder extends SvelteComponentTyped<TestimonialPlaceholderProps, TestimonialPlaceholderEvents, TestimonialPlaceholderSlots> {
16
+ }
19
17
  export {};
@@ -1,4 +1,8 @@
1
- <div role="status" class="space-y-2.5 animate-pulse max-w-lg">
1
+ <script>import classNames from 'classnames';
2
+ export let divClass = 'space-y-2.5 animate-pulse max-w-lg';
3
+ </script>
4
+
5
+ <div role="status" class={classNames(divClass, $$props.class)}>
2
6
  <div class="flex items-center space-x-2 w-full">
3
7
  <div class="h-2.5 bg-gray-200 rounded-full dark:bg-gray-700 w-32" />
4
8
  <div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-600 w-24" />
@@ -1,19 +1,17 @@
1
- /** @typedef {typeof __propDef.props} TextPlaceholderProps */
2
- /** @typedef {typeof __propDef.events} TextPlaceholderEvents */
3
- /** @typedef {typeof __propDef.slots} TextPlaceholderSlots */
4
- export default class TextPlaceholder extends SvelteComponentTyped<{}, {
5
- [evt: string]: CustomEvent<any>;
6
- }, {}> {
7
- }
8
- export type TextPlaceholderProps = typeof __propDef.props;
9
- export type TextPlaceholderEvents = typeof __propDef.events;
10
- export type TextPlaceholderSlots = typeof __propDef.slots;
11
1
  import { SvelteComponentTyped } from "svelte";
12
2
  declare const __propDef: {
13
- props: {};
3
+ props: {
4
+ [x: string]: any;
5
+ divClass?: string;
6
+ };
14
7
  events: {
15
8
  [evt: string]: CustomEvent<any>;
16
9
  };
17
10
  slots: {};
18
11
  };
12
+ export declare type TextPlaceholderProps = typeof __propDef.props;
13
+ export declare type TextPlaceholderEvents = typeof __propDef.events;
14
+ export declare type TextPlaceholderSlots = typeof __propDef.slots;
15
+ export default class TextPlaceholder extends SvelteComponentTyped<TextPlaceholderProps, TextPlaceholderEvents, TextPlaceholderSlots> {
16
+ }
19
17
  export {};
@@ -1,10 +1,9 @@
1
- <script>export let size = '48';
1
+ <script>import classNames from 'classnames';
2
+ export let divClass = 'flex justify-center items-center max-w-sm h-56 bg-gray-300 rounded-lg animate-pulse dark:bg-gray-700';
3
+ export let size = '48';
2
4
  </script>
3
5
 
4
- <div
5
- role="status"
6
- class="flex justify-center items-center max-w-sm h-56 bg-gray-300 rounded-lg animate-pulse dark:bg-gray-700"
7
- >
6
+ <div role="status" class={classNames(divClass, $$props.class)}>
8
7
  <svg
9
8
  width={size}
10
9
  height={size}
@@ -1,6 +1,8 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
2
  declare const __propDef: {
3
3
  props: {
4
+ [x: string]: any;
5
+ divClass?: string;
4
6
  size?: string;
5
7
  };
6
8
  events: {
@@ -1,7 +1,8 @@
1
- <div
2
- role="status"
3
- class="p-4 max-w-sm rounded border border-gray-200 shadow animate-pulse md:p-6 dark:border-gray-700"
4
- >
1
+ <script>import classNames from 'classnames';
2
+ export let divClass = 'p-4 max-w-sm rounded border border-gray-200 shadow animate-pulse md:p-6 dark:border-gray-700';
3
+ </script>
4
+
5
+ <div role="status" class={classNames(divClass, $$props.class)}>
5
6
  <div class="h-2.5 bg-gray-200 rounded-full dark:bg-gray-700 w-32 mb-2.5" />
6
7
  <div class="mb-10 w-48 h-2 bg-gray-200 rounded-full dark:bg-gray-700" />
7
8
  <div class="flex items-baseline mt-4 space-x-6">
@@ -1,19 +1,17 @@
1
- /** @typedef {typeof __propDef.props} WidgetPlaceholderProps */
2
- /** @typedef {typeof __propDef.events} WidgetPlaceholderEvents */
3
- /** @typedef {typeof __propDef.slots} WidgetPlaceholderSlots */
4
- export default class WidgetPlaceholder extends SvelteComponentTyped<{}, {
5
- [evt: string]: CustomEvent<any>;
6
- }, {}> {
7
- }
8
- export type WidgetPlaceholderProps = typeof __propDef.props;
9
- export type WidgetPlaceholderEvents = typeof __propDef.events;
10
- export type WidgetPlaceholderSlots = typeof __propDef.slots;
11
1
  import { SvelteComponentTyped } from "svelte";
12
2
  declare const __propDef: {
13
- props: {};
3
+ props: {
4
+ [x: string]: any;
5
+ divClass?: string;
6
+ };
14
7
  events: {
15
8
  [evt: string]: CustomEvent<any>;
16
9
  };
17
10
  slots: {};
18
11
  };
12
+ export declare type WidgetPlaceholderProps = typeof __propDef.props;
13
+ export declare type WidgetPlaceholderEvents = typeof __propDef.events;
14
+ export declare type WidgetPlaceholderSlots = typeof __propDef.slots;
15
+ export default class WidgetPlaceholder extends SvelteComponentTyped<WidgetPlaceholderProps, WidgetPlaceholderEvents, WidgetPlaceholderSlots> {
16
+ }
19
17
  export {};
@@ -1,7 +1,11 @@
1
1
  <script>import { tabStore } from './tabStores';
2
+ import classNames from 'classnames';
2
3
  export let tabs;
3
4
  export let tabId = 'myTab';
4
5
  export let activeTabValue = 1;
6
+ export let btnClass = 'inline-block py-4 px-4 text-sm font-medium text-center rounded-t-lg border-b-2 border-transparent';
7
+ 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';
8
+ 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';
5
9
  const handleClick = (tabValue) => () => {
6
10
  tabStore.update((n) => (n = tabValue));
7
11
  activeTabValue = tabValue;
@@ -36,12 +40,11 @@ Header part of Interactive tab component. Use with TabContent.
36
40
  <li class="mr-2" role="presentation">
37
41
  <button
38
42
  on:click={handleClick(id)}
39
- class="inline-block py-4 px-4 text-sm font-medium text-center text-gray-500 rounded-t-lg border-b-2 border-transparent hover:text-gray-600 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300"
43
+ class={classNames(btnClass, activeTabValue === id ? activeClass : inactiveClasses)}
40
44
  id="{name}-tab"
41
45
  data-tabs-target="#{name}"
42
46
  type="button"
43
47
  role="tab"
44
- class:active={activeTabValue === id}
45
48
  aria-controls={name}
46
49
  aria-selected="false"
47
50
  on:blur
@@ -5,6 +5,9 @@ declare const __propDef: {
5
5
  tabs: TabHeadType[];
6
6
  tabId?: string;
7
7
  activeTabValue?: number;
8
+ btnClass?: string;
9
+ activeClass?: string;
10
+ inactiveClasses?: string;
8
11
  };
9
12
  events: {
10
13
  blur: FocusEvent;
@@ -1,12 +1,16 @@
1
- <script>export let tabId = 'myTab';
1
+ <script>import classNames from 'classnames';
2
+ export let tabId = 'myTab';
2
3
  export let activeTabValue = 1;
3
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';
4
8
  const handleClick = (tabValue) => () => (activeTabValue = tabValue);
5
9
  </script>
6
10
 
7
11
  <div class="mb-4 border-b border-gray-200 dark:border-gray-700">
8
12
  <ul class="flex flex-wrap -mb-px" id={tabId} role="tablist">
9
- {#each tabs as { name, id }}
13
+ {#each tabs as { name, id, disabled }}
10
14
  <li class="mr-2" role="presentation">
11
15
  <button
12
16
  on:click={handleClick(id)}
@@ -19,12 +23,12 @@ const handleClick = (tabValue) => () => (activeTabValue = tabValue);
19
23
  on:mouseenter
20
24
  on:mouseleave
21
25
  on:mouseover
22
- class="inline-block py-4 px-4 text-sm font-medium text-center text-gray-500 rounded-t-lg border-b-2 border-transparent hover:text-gray-600 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300"
26
+ class={classNames(btnClass, activeTabValue === id ? activeClass : inactiveClasses)}
23
27
  id="{name}-tab"
24
28
  type="button"
25
29
  role="tab"
26
- class:active={activeTabValue === id}
27
- aria-controls={name}>{name}</button
30
+ aria-controls={name}
31
+ {disabled}>{name}</button
28
32
  >
29
33
  </li>
30
34
  {/each}
@@ -5,6 +5,9 @@ declare const __propDef: {
5
5
  tabId?: string;
6
6
  activeTabValue?: number;
7
7
  tabs: InteractiveTabType[];
8
+ btnClass?: string;
9
+ activeClass?: string;
10
+ inactiveClasses?: string;
8
11
  };
9
12
  events: {
10
13
  blur: FocusEvent;
@@ -0,0 +1,115 @@
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
+ >
92
+ {#if icon}
93
+ <svelte:component this={icon} size={iconSize} class={iconClass} />
94
+ {/if}
95
+ {name}</button
96
+ >
97
+ </li>
98
+ {/each}
99
+ </ul>
100
+ </div>
101
+ <div id="{tabId}Content">
102
+ {#each tabs as { name, content, id }}
103
+ {#if activeTabValue === id}
104
+ <div class={contentDivClass} id={name} role="tabpanel" aria-labelledby="{name}-tab">
105
+ {#if typeof content === 'string'}
106
+ <p class="text-sm text-gray-500 dark:text-gray-400">
107
+ {@html content}
108
+ </p>
109
+ {:else}
110
+ <svelte:component this={content} />
111
+ {/if}
112
+ </div>
113
+ {/if}
114
+ {/each}
115
+ </div>
@@ -0,0 +1,39 @@
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 {};
package/types.d.ts CHANGED
@@ -114,6 +114,10 @@ export declare type InputType = 'color' | 'date' | 'datetime-local' | 'email' |
114
114
  export interface InteractiveTabType {
115
115
  name: string;
116
116
  id: number;
117
+ active?: boolean;
118
+ disabled?: boolean;
119
+ icon?: typeof SvelteComponent;
120
+ iconSize?: number;
117
121
  content: string | typeof SvelteComponent;
118
122
  }
119
123
  export interface ListGroupItemType {