flowbite-svelte 0.26.6 → 0.26.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.
Files changed (54) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/buttons/Button.svelte +18 -19
  3. package/drawer/Drawer.svelte +54 -0
  4. package/drawer/Drawer.svelte.d.ts +30 -0
  5. package/dropdowns/Dropdown.svelte +28 -34
  6. package/dropdowns/Dropdown.svelte.d.ts +1 -2
  7. package/dropdowns/DropdownItem.svelte +2 -2
  8. package/dropdowns/DropdownItem.svelte.d.ts +1 -0
  9. package/index.d.ts +2 -0
  10. package/index.js +3 -0
  11. package/navbar/NavLi.svelte +4 -4
  12. package/package.json +5 -2
  13. package/popover/Popover.svelte +13 -15
  14. package/popover/Popover.svelte.d.ts +1 -0
  15. package/tooltips/Tooltip.svelte +14 -9
  16. package/tooltips/Tooltip.svelte.d.ts +0 -1
  17. package/typography/A.svelte +3 -3
  18. package/typography/A.svelte.d.ts +2 -2
  19. package/typography/Blockquote.svelte +2 -0
  20. package/typography/Blockquote.svelte.d.ts +1 -0
  21. package/typography/DescriptionList.svelte +2 -1
  22. package/typography/DescriptionList.svelte.d.ts +1 -0
  23. package/typography/Heading.svelte +4 -2
  24. package/typography/Heading.svelte.d.ts +2 -1
  25. package/typography/Hr.svelte +8 -7
  26. package/typography/Hr.svelte.d.ts +1 -0
  27. package/typography/Img.svelte +15 -10
  28. package/typography/Img.svelte.d.ts +1 -0
  29. package/typography/Layout.svelte +11 -0
  30. package/typography/Layout.svelte.d.ts +21 -0
  31. package/typography/Li.svelte +2 -1
  32. package/typography/Li.svelte.d.ts +1 -0
  33. package/typography/List.svelte +2 -1
  34. package/typography/List.svelte.d.ts +1 -0
  35. package/typography/Mark.svelte +4 -3
  36. package/typography/Mark.svelte.d.ts +2 -1
  37. package/typography/P.svelte +7 -4
  38. package/typography/P.svelte.d.ts +4 -1
  39. package/typography/Secondary.svelte +4 -3
  40. package/typography/Secondary.svelte.d.ts +2 -1
  41. package/typography/Span.svelte +2 -1
  42. package/typography/Span.svelte.d.ts +1 -0
  43. package/typography/Ul.svelte +2 -1
  44. package/typography/Ul.svelte.d.ts +1 -0
  45. package/utils/Chevron.svelte +23 -0
  46. package/utils/Chevron.svelte.d.ts +19 -0
  47. package/utils/Frame.svelte +21 -12
  48. package/utils/Frame.svelte.d.ts +13 -4
  49. package/utils/Popper.svelte +13 -13
  50. package/utils/Popper.svelte.d.ts +0 -1
  51. package/utils/backdrop.d.ts +6 -0
  52. package/utils/backdrop.js +90 -0
  53. package/typography/Underline.svelte +0 -7
  54. package/typography/Underline.svelte.d.ts +0 -19
package/CHANGELOG.md CHANGED
@@ -2,6 +2,51 @@
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.9](https://github.com/themesberg/flowbite-svelte/compare/v0.26.8...v0.26.9) (2022-09-04)
6
+
7
+
8
+ ### Features
9
+
10
+ * add id to typograpy components ([64cbe1b](https://github.com/themesberg/flowbite-svelte/commit/64cbe1b6f2cbe43fdf5cb71a0d82e3a5caad1586))
11
+ * add placement to Drawer component ([1b91e52](https://github.com/themesberg/flowbite-svelte/commit/1b91e52618da8935b326a69161d01f0cc7739158))
12
+ * working on drawer ([07a8e02](https://github.com/themesberg/flowbite-svelte/commit/07a8e02ceac450e7e7ceeb2ad9b98bfac7c7c1cf))
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * folder names without s and update tests ([4e9c9ce](https://github.com/themesberg/flowbite-svelte/commit/4e9c9ce69e06b1a8e4394c3920c75606894c06d3))
18
+ * no dropdown docs ([4f92d9b](https://github.com/themesberg/flowbite-svelte/commit/4f92d9b56a53677bed7264b6f044e64a10c42c7e))
19
+ * update Htwo using scroll-mt-20 ([2006490](https://github.com/themesberg/flowbite-svelte/commit/200649069a05c6df4ed0e269d3479526092afe01))
20
+
21
+ ### [0.26.8](https://github.com/themesberg/flowbite-svelte/compare/v0.26.7...v0.26.8) (2022-09-03)
22
+
23
+
24
+ ### Features
25
+
26
+ * dropdown button ([f6347f2](https://github.com/themesberg/flowbite-svelte/commit/f6347f280cbfc552d001aa22128026174b46a6f3))
27
+ * more Frame inheritance ([bb72d69](https://github.com/themesberg/flowbite-svelte/commit/bb72d6952386bd0f6dec4711795e3591a6837c02))
28
+ * popover finalization ([c71481e](https://github.com/themesberg/flowbite-svelte/commit/c71481ec18e2850488d86cfdb583587eae4a19b2))
29
+
30
+
31
+ ### Bug Fixes
32
+
33
+ * missing 683restProps ([0d52fd1](https://github.com/themesberg/flowbite-svelte/commit/0d52fd1b4168c8cc707c174dc2c18f532cf2e93c))
34
+ * no triggers error ([83075e1](https://github.com/themesberg/flowbite-svelte/commit/83075e1a969bdf93a520bd9e35b339e36bf4f325))
35
+ * remove unused imports ([acb58b9](https://github.com/themesberg/flowbite-svelte/commit/acb58b9144948feeb3c1c14b41a71d2122187340))
36
+
37
+ ### [0.26.7](https://github.com/themesberg/flowbite-svelte/compare/v0.26.6...v0.26.7) (2022-09-03)
38
+
39
+
40
+ ### Features
41
+
42
+ * add Layout component ([2204586](https://github.com/themesberg/flowbite-svelte/commit/22045861703bf3e46cc7900e15c4db64d5246c50))
43
+ * add paragraphs page ([db973a3](https://github.com/themesberg/flowbite-svelte/commit/db973a3929bfdc8c4dd48338cc114bdc2c808fb8))
44
+
45
+
46
+ ### Bug Fixes
47
+
48
+ * add html block to text page ([37e910a](https://github.com/themesberg/flowbite-svelte/commit/37e910ae269099865865580d419b8dd05dccb7a8))
49
+
5
50
  ### [0.26.6](https://github.com/themesberg/flowbite-svelte/compare/v0.26.5...v0.26.6) (2022-09-02)
6
51
 
7
52
 
@@ -77,7 +77,7 @@ const hasBorder = () => outline || color === 'alternative' || color === 'light';
77
77
  let buttonClass;
78
78
  $: buttonClass = btnClass
79
79
  ? btnClass
80
- : classNames('group text-center font-medium', group ? 'focus:ring-2' : 'focus:ring-4', group && 'focus:z-10', !group || color === 'alternative' || (outline && color === 'dark') || 'focus:outline-none', outline && gradient
80
+ : classNames('text-center font-medium', group ? 'focus:ring-2' : 'focus:ring-4', group && 'focus:z-10', !group || color === 'alternative' || (outline && color === 'dark') || 'focus:outline-none', outline && gradient
81
81
  ? 'p-0.5'
82
82
  : 'inline-flex items-center justify-center ' + sizeClasses[size], gradient ? gradientClasses[color] : outline ? outlineClasses[color] : colorClasses[color], color === 'alternative' &&
83
83
  (background
@@ -93,24 +93,23 @@ $: gradientOutlineClass = classNames('inline-flex items-center justify-center',
93
93
  </script>
94
94
 
95
95
  <svelte:element
96
- this={href ? 'a' : 'button'}
97
- type={href ? undefined : type}
98
- {href}
99
- {...$$restProps}
100
- class={buttonClass}
101
- on:click
102
- on:change
103
- on:keydown
104
- on:keyup
105
- on:mouseenter
106
- on:mouseleave
107
- >
108
- {#if outline && gradient}
109
- <!-- Trick to prentend outline without using border
96
+ this={href ? 'a' : 'button'}
97
+ type={href ? undefined : type}
98
+ {href}
99
+ {...$$restProps}
100
+ class={buttonClass}
101
+ on:click
102
+ on:change
103
+ on:keydown
104
+ on:keyup
105
+ on:mouseenter
106
+ on:mouseleave>
107
+ {#if outline && gradient}
108
+ <!-- Trick to prentend outline without using border
110
109
  This has a limitation of no supporting transparency as
111
110
  background is set to bg-white dark:bg-gray-900 -->
112
- <span class={gradientOutlineClass}><slot /></span>
113
- {:else}
114
- <slot />
115
- {/if}
111
+ <span class={gradientOutlineClass}><slot /></span>
112
+ {:else}
113
+ <slot />
114
+ {/if}
116
115
  </svelte:element>
@@ -0,0 +1,54 @@
1
+ <script>import classNames from 'classnames';
2
+ import { fly, slide, blur, fade } from 'svelte/transition';
3
+ import { clickOutside } from '../utils/clickOutside';
4
+ export let hidden = true;
5
+ export let position = 'fixed';
6
+ export let width = 'w-80';
7
+ export let backdrop = true;
8
+ export let placement = 'left';
9
+ export let id = 'drawer-example';
10
+ export let divClass = 'overflow-y-auto z-50 p-4 bg-white dark:bg-gray-800';
11
+ export let transitionParams = {};
12
+ export let transitionType = 'fly';
13
+ function multiple(node, params) {
14
+ switch (transitionType) {
15
+ case 'slide':
16
+ return slide(node, params);
17
+ case 'blur':
18
+ return blur(node, params);
19
+ case 'fly':
20
+ return fly(node, params);
21
+ case 'fade':
22
+ return fade(node, params);
23
+ }
24
+ }
25
+ const placements = {
26
+ left: 'inset-y-0 left-0',
27
+ right: 'inset-y-0 right-0',
28
+ top: 'inset-x-0 top-0',
29
+ bottom: 'inset-x-0 bottom-0'
30
+ };
31
+ const handleDrawer = () => {
32
+ hidden = !hidden;
33
+ console.log('clicked');
34
+ };
35
+ </script>
36
+
37
+ {#if !hidden}
38
+ {#if backdrop}
39
+ <div
40
+ class="fixed top-0 left-0 z-50 w-full h-full bg-gray-900/70"
41
+ on:click={() => !hidden && handleDrawer()} />
42
+ {/if}
43
+ <div
44
+ use:clickOutside={() => !hidden && handleDrawer()}
45
+ {id}
46
+ {...$$restProps}
47
+ class={classNames(divClass, width, position, placements[placement], $$props.class)}
48
+ transition:multiple={transitionParams}
49
+ tabindex="-1"
50
+ aria-controls={id}
51
+ aria-labelledby={id}>
52
+ <slot {hidden} />
53
+ </div>
54
+ {/if}
@@ -0,0 +1,30 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ import type { drawerTransitionParamTypes, drawerTransitionTypes } from '../types';
3
+ declare const __propDef: {
4
+ props: {
5
+ [x: string]: any;
6
+ hidden?: boolean;
7
+ position?: 'fixed' | 'absolute';
8
+ width?: string;
9
+ backdrop?: boolean;
10
+ placement?: 'left' | 'right' | 'top' | 'bottom';
11
+ id?: string;
12
+ divClass?: string;
13
+ transitionParams?: drawerTransitionParamTypes;
14
+ transitionType?: drawerTransitionTypes;
15
+ };
16
+ events: {
17
+ [evt: string]: CustomEvent<any>;
18
+ };
19
+ slots: {
20
+ default: {
21
+ hidden: boolean;
22
+ };
23
+ };
24
+ };
25
+ export declare type DrawerProps = typeof __propDef.props;
26
+ export declare type DrawerEvents = typeof __propDef.events;
27
+ export declare type DrawerSlots = typeof __propDef.slots;
28
+ export default class Drawer extends SvelteComponentTyped<DrawerProps, DrawerEvents, DrawerSlots> {
29
+ }
30
+ export {};
@@ -1,26 +1,13 @@
1
- <script>import Button from '../buttons/Button.svelte';
2
- import Frame from '../utils/Frame.svelte';
1
+ <script>import classNames from 'classnames';
2
+ import Button from '../buttons/Button.svelte';
3
3
  import Popper from '../utils/Popper.svelte';
4
- import classNames from 'classnames';
5
- import ChevronUp from '../utils/ChevronUp.svelte';
6
- import ChevronRight from '../utils/ChevronRight.svelte';
7
- import ChevronDown from '../utils/ChevronDown.svelte';
8
- import ChevronLeft from '../utils/ChevronLeft.svelte';
4
+ import Chevron from '../utils/Chevron.svelte';
9
5
  export let label = '';
10
6
  export let inline = false;
11
7
  export let arrowIcon = true;
12
8
  export let labelClass = 'flex items-center justify-between w-full py-2 pl-3 pr-4 font-medium text-gray-700 border-b border-gray-100 hover:bg-gray-50 md:hover:bg-transparent md:border-0 md:hover:text-blue-700 md:p-0 md:w-auto dark:text-gray-400 dark:hover:text-white dark:focus:text-white dark:border-gray-700 dark:hover:bg-gray-700 md:dark:hover:bg-transparent';
13
9
  export let placement = 'bottom';
14
10
  export let open = false;
15
- export let triggeredBy = undefined;
16
- const icons = {
17
- top: ChevronUp,
18
- right: ChevronRight,
19
- bottom: ChevronDown,
20
- left: ChevronLeft
21
- };
22
- // @ts-ignore
23
- $: icon = icons[placement.split('-')[0]];
24
11
  let popoverClass;
25
12
  $: popoverClass = classNames('outline-none', $$props.class);
26
13
  </script>
@@ -28,33 +15,40 @@ $: popoverClass = classNames('outline-none', $$props.class);
28
15
  {#if label}
29
16
  <slot name="trigger">
30
17
  {#if inline}
31
- <button class={labelClass} class:flex-row-reverse={icon == ChevronLeft}>
32
- <slot name="label">{label}</slot>
18
+ <button class={labelClass}>
33
19
  {#if arrowIcon}
34
- <svelte:component
35
- this={icon ?? ChevronDown}
36
- class={classNames('h-4 w-4', icon == ChevronLeft ? 'mr-2' : 'ml-2')} />
20
+ <Chevron {placement}><slot name="label">{label}</slot></Chevron>
21
+ {:else}
22
+ <slot name="label">{label}</slot>
37
23
  {/if}
38
24
  </button>
39
25
  {:else}
40
- <Button {...$$restProps} class={icon == ChevronLeft && 'flex-row-reverse'}>
41
- <slot name="label">{label}</slot>
26
+ <Button>
42
27
  {#if arrowIcon}
43
- <svelte:component
44
- this={icon ?? ChevronDown}
45
- class={classNames('h-4 w-4', icon == ChevronLeft ? 'mr-2' : 'ml-2')} />
28
+ <Chevron {placement}><slot name="label">{label}</slot></Chevron>
29
+ {:else}
30
+ <slot name="label">{label}</slot>
46
31
  {/if}
47
32
  </Button>
48
33
  {/if}
49
34
  </slot>
50
35
  {/if}
51
36
 
52
- <Popper activeContent={true} arrow={false} {placement} trigger="click" on:show bind:open {triggeredBy}>
53
- <Frame class={popoverClass} rounded border shadow>
54
- <slot name="content">
55
- <ul class="py-1">
56
- <slot />
57
- </ul>
58
- </slot>
59
- </Frame>
37
+ <Popper
38
+ rounded
39
+ border
40
+ shadow
41
+ activeContent
42
+ arrow={false}
43
+ {placement}
44
+ trigger="click"
45
+ {...$$restProps}
46
+ class={popoverClass}
47
+ on:show
48
+ bind:open>
49
+ <slot name="content">
50
+ <ul class="py-1">
51
+ <slot />
52
+ </ul>
53
+ </slot>
60
54
  </Popper>
@@ -7,9 +7,8 @@ declare const __propDef: {
7
7
  inline?: boolean;
8
8
  arrowIcon?: boolean;
9
9
  labelClass?: string;
10
- placement?: 'auto' | Placement;
10
+ placement?: Placement;
11
11
  open?: boolean;
12
- triggeredBy?: string;
13
12
  };
14
13
  events: {
15
14
  show: CustomEvent<any>;
@@ -1,6 +1,7 @@
1
1
  <script>import classNames from 'classnames';
2
2
  export let liClass = 'block font-medium cursor-pointer py-2 px-4 text-sm hover:bg-gray-100 dark:hover:bg-gray-600';
3
3
  export let color = 'default';
4
+ export let tabindex = 0;
4
5
  const colors = {
5
6
  default: 'text-gray-700 dark:text-gray-200 dark:hover:text-white',
6
7
  red: 'text-red-600 dark:text-red-500'
@@ -18,7 +19,6 @@ const colors = {
18
19
  on:blur
19
20
  on:mouseenter
20
21
  on:mouseleave
21
- tabindex="0"
22
- >
22
+ {tabindex}>
23
23
  <slot />
24
24
  </li>
@@ -4,6 +4,7 @@ declare const __propDef: {
4
4
  [x: string]: any;
5
5
  liClass?: string;
6
6
  color?: string;
7
+ tabindex?: number;
7
8
  };
8
9
  events: {
9
10
  click: MouseEvent;
package/index.d.ts CHANGED
@@ -11,6 +11,7 @@ export { default as Carousel } from './carousels/Carousel.svelte';
11
11
  export { default as CarouselTransition } from './carousels/CarouselTransition.svelte';
12
12
  export { default as DarkMode } from './darkmode/DarkMode.svelte';
13
13
  export { default as Datepicker } from './datepicker/Datepicker.svelte';
14
+ export { default as Drawer } from './drawer/Drawer.svelte';
14
15
  export { default as Dropdown } from './dropdowns/Dropdown.svelte';
15
16
  export { default as DropdownDivider } from './dropdowns/DropdownDivider.svelte';
16
17
  export { default as DropdownHeader } from './dropdowns/DropdownHeader.svelte';
@@ -112,6 +113,7 @@ export { default as DescriptionList } from './typography/DescriptionList.svelte'
112
113
  export { default as Heading } from './typography/Heading.svelte';
113
114
  export { default as Hr } from './typography/Hr.svelte';
114
115
  export { default as Img } from './typography/Img.svelte';
116
+ export { default as Layout } from './typography/Layout.svelte';
115
117
  export { default as Li } from './typography/Li.svelte';
116
118
  export { default as Mark } from './typography/Mark.svelte';
117
119
  export { default as List } from './typography/List.svelte';
package/index.js CHANGED
@@ -22,6 +22,8 @@ export { default as CarouselTransition } from './carousels/CarouselTransition.sv
22
22
  export { default as DarkMode } from './darkmode/DarkMode.svelte';
23
23
  // Datepicker
24
24
  export { default as Datepicker } from './datepicker/Datepicker.svelte';
25
+ // Drawer
26
+ export { default as Drawer } from './drawer/Drawer.svelte';
25
27
  // Dropdown
26
28
  export { default as Dropdown } from './dropdowns/Dropdown.svelte';
27
29
  export { default as DropdownDivider } from './dropdowns/DropdownDivider.svelte';
@@ -145,6 +147,7 @@ export { default as DescriptionList } from './typography/DescriptionList.svelte'
145
147
  export { default as Heading } from './typography/Heading.svelte';
146
148
  export { default as Hr } from './typography/Hr.svelte';
147
149
  export { default as Img } from './typography/Img.svelte';
150
+ export { default as Layout } from './typography/Layout.svelte';
148
151
  export { default as Li } from './typography/Li.svelte';
149
152
  export { default as Mark } from './typography/Mark.svelte';
150
153
  export { default as List } from './typography/List.svelte';
@@ -7,7 +7,8 @@ $: aClass = active ? activeClass : nonActiveClass;
7
7
  </script>
8
8
 
9
9
  <li>
10
- <a
10
+ <svelte:element
11
+ this={href ? 'a' : 'div'}
11
12
  {href}
12
13
  {...$$restProps}
13
14
  on:blur
@@ -20,8 +21,7 @@ $: aClass = active ? activeClass : nonActiveClass;
20
21
  on:mouseenter
21
22
  on:mouseleave
22
23
  on:mouseover
23
- class={classNames(aClass, $$props.class)}
24
- >
24
+ class={classNames(aClass, $$props.class)}>
25
25
  <slot />
26
- </a>
26
+ </svelte:element>
27
27
  </li>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flowbite-svelte",
3
- "version": "0.26.6",
3
+ "version": "0.26.9",
4
4
  "description": "Flowbite components for Svelte",
5
5
  "main": "index.js",
6
6
  "author": {
@@ -118,6 +118,7 @@
118
118
  "./darkmode/DarkMode.svelte": "./darkmode/DarkMode.svelte",
119
119
  "./datepicker/Calender.svelte": "./datepicker/Calender.svelte",
120
120
  "./datepicker/Datepicker.svelte": "./datepicker/Datepicker.svelte",
121
+ "./drawer/Drawer.svelte": "./drawer/Drawer.svelte",
121
122
  "./dropdowns/Dropdown.svelte": "./dropdowns/Dropdown.svelte",
122
123
  "./dropdowns/DropdownDivider.svelte": "./dropdowns/DropdownDivider.svelte",
123
124
  "./dropdowns/DropdownHeader.svelte": "./dropdowns/DropdownHeader.svelte",
@@ -224,6 +225,7 @@
224
225
  "./typography/Heading.svelte": "./typography/Heading.svelte",
225
226
  "./typography/Hr.svelte": "./typography/Hr.svelte",
226
227
  "./typography/Img.svelte": "./typography/Img.svelte",
228
+ "./typography/Layout.svelte": "./typography/Layout.svelte",
227
229
  "./typography/Li.svelte": "./typography/Li.svelte",
228
230
  "./typography/List.svelte": "./typography/List.svelte",
229
231
  "./typography/Mark.svelte": "./typography/Mark.svelte",
@@ -231,7 +233,7 @@
231
233
  "./typography/Secondary.svelte": "./typography/Secondary.svelte",
232
234
  "./typography/Span.svelte": "./typography/Span.svelte",
233
235
  "./typography/Ul.svelte": "./typography/Ul.svelte",
234
- "./typography/Underline.svelte": "./typography/Underline.svelte",
236
+ "./utils/Chevron.svelte": "./utils/Chevron.svelte",
235
237
  "./utils/ChevronDown.svelte": "./utils/ChevronDown.svelte",
236
238
  "./utils/ChevronLeft.svelte": "./utils/ChevronLeft.svelte",
237
239
  "./utils/ChevronRight.svelte": "./utils/ChevronRight.svelte",
@@ -242,6 +244,7 @@
242
244
  "./utils/Popper.svelte": "./utils/Popper.svelte",
243
245
  "./utils/UserCircle.svelte": "./utils/UserCircle.svelte",
244
246
  "./utils/Wrapper.svelte": "./utils/Wrapper.svelte",
247
+ "./utils/backdrop": "./utils/backdrop.js",
245
248
  "./utils/clickOutside": "./utils/clickOutside.js",
246
249
  "./utils/createEventDispatcher": "./utils/createEventDispatcher.js",
247
250
  "./utils/focusTrap": "./utils/focusTrap.js",
@@ -1,20 +1,18 @@
1
1
  <script>import Popper from '../utils/Popper.svelte';
2
- import classNames from 'classnames';
3
2
  export let title = '';
4
- let popoverClass;
5
- $: popoverClass = classNames('rounded-lg shadow-sm', 'bg-white dark:bg-gray-800', 'text-gray-500 dark:text-gray-400', 'border border-gray-200 dark:border-gray-700', $$props.class);
3
+ export let defaultClass = 'py-2 px-3';
6
4
  </script>
7
5
 
8
- <Popper activeContent={true} {...$$restProps} class={popoverClass} on:show>
9
- {#if $$slots.title || title}
10
- <div
11
- class="py-2 px-3 bg-gray-100 rounded-t-lg border-b border-gray-200 dark:border-gray-600 dark:bg-gray-700">
12
- <slot name="title">
13
- <h3 class="font-semibold text-gray-900 dark:text-white">{title}</h3>
14
- </slot>
15
- </div>
16
- {/if}
17
- <div class="py-2 px-3">
18
- <slot />
19
- </div>
6
+ <Popper activeContent border shadow rounded {...$$restProps} class={$$props.class} on:show>
7
+ {#if $$slots.title || title}
8
+ <div
9
+ class="py-2 px-3 bg-gray-100 rounded-t-lg border-b border-gray-200 dark:border-gray-600 dark:bg-gray-700">
10
+ <slot name="title">
11
+ <h3 class="font-semibold text-gray-900 dark:text-white">{title}</h3>
12
+ </slot>
13
+ </div>
14
+ {/if}
15
+ <div class={defaultClass}>
16
+ <slot />
17
+ </div>
20
18
  </Popper>
@@ -3,6 +3,7 @@ declare const __propDef: {
3
3
  props: {
4
4
  [x: string]: any;
5
5
  title?: string;
6
+ defaultClass?: string;
6
7
  };
7
8
  events: {
8
9
  show: CustomEvent<any>;
@@ -1,19 +1,24 @@
1
1
  <script>import Popper from '../utils/Popper.svelte';
2
2
  import classNames from 'classnames';
3
- export let color = '';
4
- export let style = 'dark';
5
- export let tipClass = 'py-2 px-3 text-sm font-medium rounded-lg shadow-sm tooltip';
6
- export let triggeredBy;
3
+ export let color = 'custom';
4
+ export let style = 'auto';
5
+ export let tipClass = 'py-2 px-3 text-sm font-medium';
7
6
  const colors = {
8
- dark: 'border border-gray-800 bg-gray-900 text-white dark:bg-gray-700 dark:border-gray-600',
9
- light: 'border border-gray-200 bg-white text-gray-900',
10
- auto: 'border border-gray-200 bg-white text-gray-900 dark:bg-gray-700 dark:text-white dark:border-gray-600 ',
11
- custom: color
7
+ dark: 'border-gray-800 bg-gray-900 text-white dark:bg-gray-700 dark:border-gray-600',
8
+ light: 'border-gray-200 bg-white text-gray-900',
9
+ auto: 'border-gray-200 bg-white text-gray-900 dark:bg-gray-700 dark:text-white dark:border-gray-600 '
12
10
  };
13
11
  let toolTipClass;
14
12
  $: toolTipClass = classNames(tipClass, colors[style], $$props.class);
15
13
  </script>
16
14
 
17
- <Popper activeContent={false} {triggeredBy} {...$$restProps} class={toolTipClass} on:show>
15
+ <Popper
16
+ rounded
17
+ border
18
+ shadow
19
+ color={style === 'custom' ? color : 'none'}
20
+ {...$$restProps}
21
+ class={toolTipClass}
22
+ on:show>
18
23
  <slot />
19
24
  </Popper>
@@ -5,7 +5,6 @@ declare const __propDef: {
5
5
  color?: string;
6
6
  style?: 'dark' | 'light' | 'auto' | 'custom';
7
7
  tipClass?: string;
8
- triggeredBy: string;
9
8
  };
10
9
  events: {
11
10
  show: CustomEvent<any>;
@@ -1,10 +1,10 @@
1
1
  <script>import classNames from 'classnames';
2
+ export let id;
2
3
  export let href = '#';
3
- export let textColor = 'text-blue-600 dark:text-blue-500';
4
+ export let color = 'text-blue-600 dark:text-blue-500';
4
5
  export let aClass = 'inline-flex items-center hover:underline';
5
- export let textSize = 'text-lg';
6
6
  </script>
7
7
 
8
- <a {href} class={classNames(aClass, textColor, textSize, $$props.class)}>
8
+ <a {href} {id} class={classNames(aClass, color, $$props.class)}>
9
9
  <slot />
10
10
  </a>
@@ -2,10 +2,10 @@ import { SvelteComponentTyped } from "svelte";
2
2
  declare const __propDef: {
3
3
  props: {
4
4
  [x: string]: any;
5
+ id: string;
5
6
  href?: string;
6
- textColor?: string;
7
+ color?: string;
7
8
  aClass?: string;
8
- textSize?: string;
9
9
  };
10
10
  events: {
11
11
  [evt: string]: CustomEvent<any>;
@@ -1,4 +1,5 @@
1
1
  <script>import classNames from 'classnames';
2
+ export let id;
2
3
  export let border = false;
3
4
  export let italic = true;
4
5
  export let borderClass = 'border-l-4 border-gray-300 dark:border-gray-500';
@@ -30,6 +31,7 @@ const sizes = {
30
31
  </script>
31
32
 
32
33
  <blockquote
34
+ {id}
33
35
  class={classNames(
34
36
  baseClass,
35
37
  alignmentClasses[alignment],
@@ -2,6 +2,7 @@ import { SvelteComponentTyped } from "svelte";
2
2
  declare const __propDef: {
3
3
  props: {
4
4
  [x: string]: any;
5
+ id: string;
5
6
  border?: boolean;
6
7
  italic?: boolean;
7
8
  borderClass?: string;
@@ -1,10 +1,11 @@
1
1
  <script>import classNames from 'classnames';
2
+ export let id;
2
3
  export let tag;
3
4
  export let dtClass = 'text-gray-500 md:text-lg dark:text-gray-400';
4
5
  export let ddClass = 'text-lg font-semibold';
5
6
  let classDesc = classNames(tag === 'dt' ? dtClass : ddClass, $$props.class);
6
7
  </script>
7
8
 
8
- <svelte:element this={tag} class={classDesc}>
9
+ <svelte:element this={tag} {id} class={classDesc}>
9
10
  <slot />
10
11
  </svelte:element>
@@ -2,6 +2,7 @@ import { SvelteComponentTyped } from "svelte";
2
2
  declare const __propDef: {
3
3
  props: {
4
4
  [x: string]: any;
5
+ id: string;
5
6
  tag: 'dt' | 'dd';
6
7
  dtClass?: string;
7
8
  ddClass?: string;
@@ -1,7 +1,8 @@
1
1
  <script>import classNames from 'classnames';
2
2
  export let tag = 'h1';
3
- export let textColor = 'text-gray-900 dark:text-white';
3
+ export let color = 'text-gray-900 dark:text-white';
4
4
  export let customSize;
5
+ export let id;
5
6
  const textSizes = {
6
7
  h1: 'text-5xl font-extrabold',
7
8
  h2: 'text-4xl font-bold',
@@ -14,6 +15,7 @@ const textSizes = {
14
15
 
15
16
  <svelte:element
16
17
  this={tag}
17
- class={classNames(customSize ? customSize : textSizes[tag], textColor, 'w-full', $$props.class)}>
18
+ {id}
19
+ class={classNames(customSize ? customSize : textSizes[tag], color, 'w-full', $$props.class)}>
18
20
  <slot />
19
21
  </svelte:element>
@@ -3,8 +3,9 @@ declare const __propDef: {
3
3
  props: {
4
4
  [x: string]: any;
5
5
  tag?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
6
- textColor?: string;
6
+ color?: string;
7
7
  customSize: string;
8
+ id: string;
8
9
  };
9
10
  events: {
10
11
  [evt: string]: CustomEvent<any>;
@@ -1,4 +1,5 @@
1
1
  <script>import classNames from 'classnames';
2
+ export let id;
2
3
  export let icon = false;
3
4
  export let width = 'w-full';
4
5
  export let height = 'h-px';
@@ -13,12 +14,12 @@ let middleClass = classNames(middleBgColor, icon ? iconDivClass : textSpanClass)
13
14
  </script>
14
15
 
15
16
  {#if $$slots}
16
- <div class={classDiv}>
17
- <hr class={horizontalClass} />
18
- <div class={middleClass}>
19
- <slot />
20
- </div>
21
- </div>
17
+ <div class={classDiv} {id}>
18
+ <hr class={horizontalClass} />
19
+ <div class={middleClass}>
20
+ <slot />
21
+ </div>
22
+ </div>
22
23
  {:else}
23
- <hr class={horizontalClass} />
24
+ <hr class={horizontalClass} />
24
25
  {/if}
@@ -2,6 +2,7 @@ import { SvelteComponentTyped } from "svelte";
2
2
  declare const __propDef: {
3
3
  props: {
4
4
  [x: string]: any;
5
+ id: string;
5
6
  icon?: boolean;
6
7
  width?: string;
7
8
  height?: string;