flowbite-svelte 0.30.6 → 0.31.1
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/dist/accordions/AccordionItem.svelte +2 -2
- package/dist/banner/Banner.svelte +56 -0
- package/dist/banner/Banner.svelte.d.ts +34 -0
- package/dist/darkmode/DarkMode.svelte +12 -15
- package/dist/forms/NumberInput.svelte +17 -1
- package/dist/forms/NumberInput.svelte.d.ts +14 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -0
- package/dist/navbar/NavLi.svelte +1 -1
- package/dist/timelines/Timeline.svelte +2 -2
- package/dist/timelines/TimelineHorizontal.svelte +2 -2
- package/package.json +10 -10
|
@@ -40,8 +40,8 @@ let buttonClass;
|
|
|
40
40
|
$: buttonClass = classNames(defaultClass, ctx.flush ? 'py-5' : 'p-5', open && (ctx.flush ? 'text-gray-900 dark:text-white' : activeClasses || ctx.activeClasses), !open && (ctx.flush ? 'text-gray-500 dark:text-gray-400' : inactiveClasses || ctx.inactiveClasses), $$props.class);
|
|
41
41
|
</script>
|
|
42
42
|
|
|
43
|
-
<h2
|
|
44
|
-
<button on:click={handleToggle} type="button" class={buttonClass}>
|
|
43
|
+
<h2 class="group">
|
|
44
|
+
<button on:click={handleToggle} type="button" class={buttonClass} aria-expanded={open}>
|
|
45
45
|
<slot name="header" />
|
|
46
46
|
{#if open}
|
|
47
47
|
<slot name="arrowup"><ChevronUp /></slot>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<script>import classNames from 'classnames';
|
|
2
|
+
import CloseButton from '../utils/CloseButton.svelte';
|
|
3
|
+
export let id = 'sticky-banner';
|
|
4
|
+
export let position = 'sticky';
|
|
5
|
+
export let dismissable = true;
|
|
6
|
+
export let bannerType = 'default';
|
|
7
|
+
export let divDefault = 'z-50 flex justify-between p-4 dark:bg-gray-700 dark:border-gray-600';
|
|
8
|
+
export let insideDiv = 'flex';
|
|
9
|
+
const divClasses = {
|
|
10
|
+
default: 'top-0 left-0 w-full border-b border-gray-200 bg-gray-50',
|
|
11
|
+
bottom: 'bottom-0 left-0 w-full border-t border-gray-200 bg-gray-50',
|
|
12
|
+
cta: 'flex-col md:flex-row w-[calc(100%-2rem)] -translate-x-1/2 bg-white border border-gray-100 rounded-lg shadow-sm lg:max-w-7xl left-1/2 top-6',
|
|
13
|
+
signup: 'top-0 left-0 w-full border-b border-gray-200 bg-gray-50',
|
|
14
|
+
info: 'top-0 left-0 flex-col w-full border-b border-gray-200 md:flex-row bg-gray-50',
|
|
15
|
+
custom: ''
|
|
16
|
+
};
|
|
17
|
+
const insideDivClasses = {
|
|
18
|
+
default: 'items-center mx-auto',
|
|
19
|
+
bottom: 'items-center mx-auto',
|
|
20
|
+
cta: 'flex-col items-start mb-3 mr-4 md:items-center md:flex-row md:mb-0',
|
|
21
|
+
signup: 'items-center flex-shrink-0 w-full mx-auto sm:w-auto',
|
|
22
|
+
info: 'items-center flex-shrink-0',
|
|
23
|
+
custom: ''
|
|
24
|
+
};
|
|
25
|
+
$: divClass = classNames(position, divDefault, divClasses[bannerType], $$props.outerDiv);
|
|
26
|
+
$: div2Class = classNames(insideDiv, insideDivClasses[bannerType], $$props.innerDiv);
|
|
27
|
+
let show = true;
|
|
28
|
+
$: handleHide = () => {
|
|
29
|
+
show = !show;
|
|
30
|
+
};
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
{#if show}
|
|
34
|
+
<div {id} tabindex="-1" class={divClass} {...$$restProps} >
|
|
35
|
+
<slot name="header" />
|
|
36
|
+
<div class={div2Class}>
|
|
37
|
+
<slot />
|
|
38
|
+
</div>
|
|
39
|
+
{#if dismissable}
|
|
40
|
+
<div class="flex items-center">
|
|
41
|
+
<CloseButton
|
|
42
|
+
class="-mx-1.5 -my-1.5"
|
|
43
|
+
color={$$restProps.color}
|
|
44
|
+
on:click={handleHide}
|
|
45
|
+
on:click
|
|
46
|
+
on:change
|
|
47
|
+
on:keydown
|
|
48
|
+
on:keyup
|
|
49
|
+
on:focus
|
|
50
|
+
on:blur
|
|
51
|
+
on:mouseenter
|
|
52
|
+
on:mouseleave />
|
|
53
|
+
</div>
|
|
54
|
+
{/if}
|
|
55
|
+
</div>
|
|
56
|
+
{/if}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
[x: string]: any;
|
|
5
|
+
id?: string | undefined;
|
|
6
|
+
position?: "static" | "fixed" | "absolute" | "relative" | "sticky" | undefined;
|
|
7
|
+
dismissable?: boolean | undefined;
|
|
8
|
+
bannerType?: "default" | "custom" | "bottom" | "cta" | "signup" | "info" | undefined;
|
|
9
|
+
divDefault?: string | undefined;
|
|
10
|
+
insideDiv?: string | undefined;
|
|
11
|
+
};
|
|
12
|
+
events: {
|
|
13
|
+
click: MouseEvent;
|
|
14
|
+
change: CustomEvent<any>;
|
|
15
|
+
keydown: CustomEvent<any>;
|
|
16
|
+
keyup: CustomEvent<any>;
|
|
17
|
+
focus: CustomEvent<any>;
|
|
18
|
+
blur: CustomEvent<any>;
|
|
19
|
+
mouseenter: CustomEvent<any>;
|
|
20
|
+
mouseleave: CustomEvent<any>;
|
|
21
|
+
} & {
|
|
22
|
+
[evt: string]: CustomEvent<any>;
|
|
23
|
+
};
|
|
24
|
+
slots: {
|
|
25
|
+
header: {};
|
|
26
|
+
default: {};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export type BannerProps = typeof __propDef.props;
|
|
30
|
+
export type BannerEvents = typeof __propDef.events;
|
|
31
|
+
export type BannerSlots = typeof __propDef.slots;
|
|
32
|
+
export default class Banner extends SvelteComponentTyped<BannerProps, BannerEvents, BannerSlots> {
|
|
33
|
+
}
|
|
34
|
+
export {};
|
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
<script>import
|
|
1
|
+
<script>import { onMount } from 'svelte';
|
|
2
|
+
import classNames from 'classnames';
|
|
2
3
|
export let btnClass = 'text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-700 rounded-lg text-sm p-2.5';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
localStorage.
|
|
6
|
-
|
|
7
|
-
</script>
|
|
8
|
-
|
|
9
|
-
<svelte:head>
|
|
10
|
-
<script>
|
|
11
|
-
if (window) {
|
|
12
|
-
localStorage.getItem('color-theme') === 'dark' ||
|
|
13
|
-
(!('color-theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)
|
|
4
|
+
let toggleTheme;
|
|
5
|
+
onMount(() => {
|
|
6
|
+
localStorage.getItem('color-theme') === 'dark' ||
|
|
7
|
+
(!('color-theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)
|
|
14
8
|
? window.document.documentElement.classList.add('dark')
|
|
15
9
|
: window.document.documentElement.classList.remove('dark');
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
toggleTheme = () => {
|
|
11
|
+
const isDark = window.document.documentElement.classList.toggle('dark');
|
|
12
|
+
localStorage.setItem('color-theme', isDark ? 'dark' : 'light');
|
|
13
|
+
};
|
|
14
|
+
});
|
|
15
|
+
</script>
|
|
19
16
|
|
|
20
17
|
<button
|
|
21
18
|
on:click={toggleTheme}
|
|
@@ -3,5 +3,21 @@ export let value = 0;
|
|
|
3
3
|
</script>
|
|
4
4
|
|
|
5
5
|
<Input let:props {...$$restProps}>
|
|
6
|
-
<input
|
|
6
|
+
<input
|
|
7
|
+
{...props}
|
|
8
|
+
type="number"
|
|
9
|
+
bind:value
|
|
10
|
+
on:blur
|
|
11
|
+
on:change
|
|
12
|
+
on:click
|
|
13
|
+
on:contextmenu
|
|
14
|
+
on:focus
|
|
15
|
+
on:keydown
|
|
16
|
+
on:keypress
|
|
17
|
+
on:keyup
|
|
18
|
+
on:mouseover
|
|
19
|
+
on:mouseenter
|
|
20
|
+
on:mouseleave
|
|
21
|
+
on:paste
|
|
22
|
+
on:input />
|
|
7
23
|
</Input>
|
|
@@ -5,6 +5,20 @@ declare const __propDef: {
|
|
|
5
5
|
value?: number | undefined;
|
|
6
6
|
};
|
|
7
7
|
events: {
|
|
8
|
+
blur: FocusEvent;
|
|
9
|
+
change: Event;
|
|
10
|
+
click: MouseEvent;
|
|
11
|
+
contextmenu: MouseEvent;
|
|
12
|
+
focus: FocusEvent;
|
|
13
|
+
keydown: KeyboardEvent;
|
|
14
|
+
keypress: KeyboardEvent;
|
|
15
|
+
keyup: KeyboardEvent;
|
|
16
|
+
mouseover: MouseEvent;
|
|
17
|
+
mouseenter: MouseEvent;
|
|
18
|
+
mouseleave: MouseEvent;
|
|
19
|
+
paste: ClipboardEvent;
|
|
20
|
+
input: Event;
|
|
21
|
+
} & {
|
|
8
22
|
[evt: string]: CustomEvent<any>;
|
|
9
23
|
};
|
|
10
24
|
slots: {};
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export { default as AccordionItem } from "./accordions/AccordionItem.svelte";
|
|
|
3
3
|
export { default as Alert } from "./alerts/Alert.svelte";
|
|
4
4
|
export { default as Avatar } from "./avatar/Avatar.svelte";
|
|
5
5
|
export { default as Badge } from "./badges/Badge.svelte";
|
|
6
|
+
export { default as Banner } from "./banner/Banner.svelte";
|
|
6
7
|
export { default as Breadcrumb } from "./breadcrumbs/Breadcrumb.svelte";
|
|
7
8
|
export { default as BreadcrumbItem } from "./breadcrumbs/BreadcrumbItem.svelte";
|
|
8
9
|
export { default as Button } from "./buttons/Button.svelte";
|
package/dist/index.js
CHANGED
|
@@ -11,6 +11,9 @@ export { default as Avatar } from './avatar/Avatar.svelte';
|
|
|
11
11
|
// Badges
|
|
12
12
|
export { default as Badge } from './badges/Badge.svelte';
|
|
13
13
|
|
|
14
|
+
// Banner
|
|
15
|
+
export { default as Banner } from './banner/Banner.svelte'
|
|
16
|
+
|
|
14
17
|
// Breadcrumbs
|
|
15
18
|
export { default as Breadcrumb } from './breadcrumbs/Breadcrumb.svelte';
|
|
16
19
|
export { default as BreadcrumbItem } from './breadcrumbs/BreadcrumbItem.svelte';
|
package/dist/navbar/NavLi.svelte
CHANGED
|
@@ -4,7 +4,7 @@ export let href = '';
|
|
|
4
4
|
export let active = false;
|
|
5
5
|
export let activeClass = undefined;
|
|
6
6
|
export let nonActiveClass = undefined;
|
|
7
|
-
const context = getContext('navbar');
|
|
7
|
+
const context = getContext('navbar') ?? {};
|
|
8
8
|
let liClass;
|
|
9
9
|
$: liClass = classNames('block py-2 pr-4 pl-3 md:p-0 rounded md:border-0', active ? activeClass ?? context.activeClass : nonActiveClass ?? context.nonActiveClass, $$props.class);
|
|
10
10
|
</script>
|
|
@@ -4,7 +4,7 @@ export let order = 'default';
|
|
|
4
4
|
setContext('order', order);
|
|
5
5
|
let olClasses = {
|
|
6
6
|
group: 'p-5 mb-4 bg-gray-50 rounded-lg border border-gray-100 dark:bg-gray-800 dark:border-gray-700',
|
|
7
|
-
horizontal: '
|
|
7
|
+
horizontal: 'sm:flex',
|
|
8
8
|
activity: 'relative border-l border-gray-200 dark:border-gray-700',
|
|
9
9
|
vertical: 'relative border-l border-gray-200 dark:border-gray-700',
|
|
10
10
|
default: 'relative border-l border-gray-200 dark:border-gray-700',
|
|
@@ -13,5 +13,5 @@ let olClasses = {
|
|
|
13
13
|
</script>
|
|
14
14
|
|
|
15
15
|
<ol class={olClasses[order]}>
|
|
16
|
-
|
|
16
|
+
<slot />
|
|
17
17
|
</ol>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flowbite-svelte",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.31.1",
|
|
4
4
|
"description": "Flowbite components for Svelte",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Shinichi Okada",
|
|
@@ -33,16 +33,16 @@
|
|
|
33
33
|
"svelte": "^3.55.1"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@playwright/test": "^1.
|
|
37
|
-
"@sveltejs/adapter-vercel": "^2.
|
|
38
|
-
"@sveltejs/kit": "^1.
|
|
36
|
+
"@playwright/test": "^1.31.2",
|
|
37
|
+
"@sveltejs/adapter-vercel": "^2.2.1",
|
|
38
|
+
"@sveltejs/kit": "^1.9.3",
|
|
39
39
|
"@sveltejs/package": "2.0.1",
|
|
40
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
41
|
-
"@typescript-eslint/parser": "^5.
|
|
40
|
+
"@typescript-eslint/eslint-plugin": "^5.54.0",
|
|
41
|
+
"@typescript-eslint/parser": "^5.54.0",
|
|
42
42
|
"autoprefixer": "^10.4.13",
|
|
43
43
|
"createprops": "^0.4.9",
|
|
44
44
|
"esbuild": "0.17.9",
|
|
45
|
-
"eslint": "^8.
|
|
45
|
+
"eslint": "^8.35.0",
|
|
46
46
|
"eslint-config-prettier": "^8.6.0",
|
|
47
47
|
"eslint-plugin-svelte3": "^4.0.0",
|
|
48
48
|
"mdsvex": "^0.10.6",
|
|
@@ -54,14 +54,14 @@
|
|
|
54
54
|
"prism-themes": "^1.9.0",
|
|
55
55
|
"publint": "^0.1.9",
|
|
56
56
|
"svelte": "^3.55.1",
|
|
57
|
-
"svelte-check": "^3.0.
|
|
57
|
+
"svelte-check": "^3.0.4",
|
|
58
58
|
"svelte-meta-tags": "^2.6.5",
|
|
59
59
|
"svelte-preprocess": "^5.0.1",
|
|
60
|
-
"svelte2tsx": "^0.6.
|
|
60
|
+
"svelte2tsx": "^0.6.2",
|
|
61
61
|
"tailwindcss": "^3.2.7",
|
|
62
62
|
"tslib": "^2.5.0",
|
|
63
63
|
"typescript": "^4.9.5",
|
|
64
|
-
"vite": "^4.1.
|
|
64
|
+
"vite": "^4.1.4",
|
|
65
65
|
"vitest": "^0.28.5"
|
|
66
66
|
},
|
|
67
67
|
"type": "module",
|