flowbite-svelte 0.45.1 → 0.46.0
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.
|
@@ -10,6 +10,7 @@ export let color = group ? (outline ? 'dark' : 'alternative') : 'primary';
|
|
|
10
10
|
export let shadow = false;
|
|
11
11
|
export let tag = 'button';
|
|
12
12
|
export let checked = undefined;
|
|
13
|
+
export let disabled = false;
|
|
13
14
|
const colorClasses = {
|
|
14
15
|
alternative: 'text-gray-900 bg-white border border-gray-200 hover:bg-gray-100 dark:bg-gray-800 dark:text-gray-400 hover:text-primary-700 focus-within:text-primary-700 dark:focus-within:text-white dark:hover:text-white dark:hover:bg-gray-700',
|
|
15
16
|
blue: 'text-white bg-blue-700 hover:bg-blue-800 dark:bg-blue-600 dark:hover:bg-blue-700',
|
|
@@ -82,7 +83,7 @@ let buttonClass;
|
|
|
82
83
|
$: buttonClass = twMerge('text-center font-medium', group ? 'focus-within:ring-2' : 'focus-within:ring-4', group && 'focus-within:z-10', group || 'focus-within:outline-none', 'inline-flex items-center justify-center ' + sizeClasses[size], outline && checked && 'border dark:border-gray-900', outline && checked && colorCheckedClasses[color], outline && !checked && outlineClasses[color], !outline && checked && colorCheckedClasses[color], !outline && !checked && colorClasses[color], color === 'alternative' && (group && !checked ? 'dark:bg-gray-700 dark:text-white dark:border-gray-700 dark:hover:border-gray-600 dark:hover:bg-gray-600' : 'dark:bg-transparent dark:border-gray-600 dark:hover:border-gray-600'), outline && color === 'dark' && (group ? (checked ? 'bg-gray-900 border-gray-800 dark:border-white dark:bg-gray-600' : 'dark:text-white border-gray-800 dark:border-white') : 'dark:text-gray-400 dark:border-gray-700'), coloredFocusClasses[color], hasBorder() && group && 'border-s-0 first:border-s', group ? (pill && 'first:rounded-s-full last:rounded-e-full') || 'first:rounded-s-lg last:rounded-e-lg' : (pill && 'rounded-full') || 'rounded-lg', shadow && 'shadow-lg', shadow && coloredShadowClasses[color], $$props.disabled && 'cursor-not-allowed opacity-50', $$props.class);
|
|
83
84
|
</script>
|
|
84
85
|
|
|
85
|
-
{#if href}
|
|
86
|
+
{#if href && !disabled}
|
|
86
87
|
<a {href} {...$$restProps} class={buttonClass} role="button" on:click on:change on:keydown on:keyup on:touchstart|passive on:touchend on:touchcancel on:mouseenter on:mouseleave>
|
|
87
88
|
<slot />
|
|
88
89
|
</a>
|
|
@@ -109,4 +110,5 @@ $: buttonClass = twMerge('text-center font-medium', group ? 'focus-within:ring-2
|
|
|
109
110
|
@prop export let shadow: boolean = false;
|
|
110
111
|
@prop export let tag: string = 'button';
|
|
111
112
|
@prop export let checked: boolean | undefined = undefined;
|
|
113
|
+
@prop export let disabled: boolean = false;
|
|
112
114
|
-->
|
|
@@ -12,6 +12,7 @@ declare const __propDef: {
|
|
|
12
12
|
shadow?: boolean | undefined;
|
|
13
13
|
tag?: string | undefined;
|
|
14
14
|
checked?: boolean | undefined;
|
|
15
|
+
disabled?: boolean | undefined;
|
|
15
16
|
};
|
|
16
17
|
events: {
|
|
17
18
|
click: MouseEvent;
|
|
@@ -45,6 +46,7 @@ export type ButtonSlots = typeof __propDef.slots;
|
|
|
45
46
|
* @prop export let shadow: boolean = false;
|
|
46
47
|
* @prop export let tag: string = 'button';
|
|
47
48
|
* @prop export let checked: boolean | undefined = undefined;
|
|
49
|
+
* @prop export let disabled: boolean = false;
|
|
48
50
|
*/
|
|
49
51
|
export default class Button extends SvelteComponent<ButtonProps, ButtonEvents, ButtonSlots> {
|
|
50
52
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/buttons/Button.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAEvC;AAID,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"Button.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/buttons/Button.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAEvC;AAID,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AA4I5D,QAAA,MAAM,SAAS;;;;;;eADkP,MAAM,GAAG,SAAS;eAAS,oBAAoB,CAAC,MAAM,CAAC;;;;kBAAiE,OAAO,GAAG,SAAS;;;;;;;;;;;;;;;;;;;CAC9T,CAAC;AAC/E,MAAM,MAAM,WAAW,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AACjD,MAAM,MAAM,YAAY,GAAG,OAAO,SAAS,CAAC,MAAM,CAAC;AACnD,MAAM,MAAM,WAAW,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAEjD;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,eAAe,CAAC,WAAW,EAAE,YAAY,EAAE,WAAW,CAAC;CAC1F"}
|
|
@@ -46,7 +46,7 @@ let grayStars = comment.total - roundedRating;
|
|
|
46
46
|
{#if helpfullink || abuselink}
|
|
47
47
|
<div class="flex items-center mt-3 space-x-3 rtl:space-x-reverse divide-x rtl:divide-x-reverse divide-gray-200 dark:divide-gray-600">
|
|
48
48
|
{#if helpfullink}
|
|
49
|
-
<Button size="xs" href=
|
|
49
|
+
<Button size="xs" href={helpfullink} color="dark">Helpful</Button>
|
|
50
50
|
{/if}
|
|
51
51
|
{#if abuselink}
|
|
52
52
|
<a href={abuselink} class="ps-4 text-sm font-medium text-primary-600 hover:underline dark:text-primary-500"> Report abuse </a>
|
package/dist/tabs/Tabs.svelte
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
<script>import { twMerge } from 'tailwind-merge';
|
|
5
5
|
import { setContext } from 'svelte';
|
|
6
|
-
export let
|
|
6
|
+
export let tabStyle = 'none';
|
|
7
7
|
export let defaultClass = 'flex flex-wrap space-x-2 rtl:space-x-reverse';
|
|
8
8
|
export let contentClass = 'p-4 bg-gray-50 rounded-lg dark:bg-gray-800 mt-4';
|
|
9
9
|
export let divider = true;
|
|
@@ -23,11 +23,11 @@ const styledInactiveClasses = {
|
|
|
23
23
|
none: ''
|
|
24
24
|
};
|
|
25
25
|
const ctx = {
|
|
26
|
-
activeClasses: styledActiveClasses[
|
|
27
|
-
inactiveClasses: styledInactiveClasses[
|
|
26
|
+
activeClasses: styledActiveClasses[tabStyle] || activeClasses,
|
|
27
|
+
inactiveClasses: styledInactiveClasses[tabStyle] || inactiveClasses,
|
|
28
28
|
selected: writable()
|
|
29
29
|
};
|
|
30
|
-
$: divider = ['full', 'pill'].includes(
|
|
30
|
+
$: divider = ['full', 'pill'].includes(tabStyle) ? false : divider;
|
|
31
31
|
setContext('ctx', ctx);
|
|
32
32
|
function init(node) {
|
|
33
33
|
const destroy = ctx.selected.subscribe((x) => {
|
|
@@ -36,11 +36,11 @@ function init(node) {
|
|
|
36
36
|
});
|
|
37
37
|
return { destroy };
|
|
38
38
|
}
|
|
39
|
-
$: ulClass = twMerge(defaultClass,
|
|
39
|
+
$: ulClass = twMerge(defaultClass, tabStyle === 'underline' && '-mb-px', $$props.class);
|
|
40
40
|
</script>
|
|
41
41
|
|
|
42
42
|
<ul class={ulClass}>
|
|
43
|
-
<slot {
|
|
43
|
+
<slot {tabStyle} />
|
|
44
44
|
</ul>
|
|
45
45
|
{#if divider}
|
|
46
46
|
<slot name="divider">
|
|
@@ -53,7 +53,7 @@ $: ulClass = twMerge(defaultClass, style === 'underline' && '-mb-px', $$props.cl
|
|
|
53
53
|
@component
|
|
54
54
|
[Go to docs](https://flowbite-svelte.com/)
|
|
55
55
|
## Props
|
|
56
|
-
@prop export let
|
|
56
|
+
@prop export let tabStyle: 'full' | 'pill' | 'underline' | 'none' = 'none';
|
|
57
57
|
@prop export let defaultClass: string = 'flex flex-wrap space-x-2 rtl:space-x-reverse';
|
|
58
58
|
@prop export let contentClass: string = 'p-4 bg-gray-50 rounded-lg dark:bg-gray-800 mt-4';
|
|
59
59
|
@prop export let divider: boolean = true;
|
|
@@ -8,7 +8,7 @@ export interface TabCtxType {
|
|
|
8
8
|
declare const __propDef: {
|
|
9
9
|
props: {
|
|
10
10
|
[x: string]: any;
|
|
11
|
-
|
|
11
|
+
tabStyle?: "none" | "pill" | "underline" | "full" | undefined;
|
|
12
12
|
defaultClass?: string | undefined;
|
|
13
13
|
contentClass?: string | undefined;
|
|
14
14
|
divider?: boolean | undefined;
|
|
@@ -20,7 +20,7 @@ declare const __propDef: {
|
|
|
20
20
|
};
|
|
21
21
|
slots: {
|
|
22
22
|
default: {
|
|
23
|
-
|
|
23
|
+
tabStyle: "none" | "pill" | "underline" | "full";
|
|
24
24
|
};
|
|
25
25
|
divider: {};
|
|
26
26
|
};
|
|
@@ -31,7 +31,7 @@ export type TabsSlots = typeof __propDef.slots;
|
|
|
31
31
|
/**
|
|
32
32
|
* [Go to docs](https://flowbite-svelte.com/)
|
|
33
33
|
* ## Props
|
|
34
|
-
* @prop export let
|
|
34
|
+
* @prop export let tabStyle: 'full' | 'pill' | 'underline' | 'none' = 'none';
|
|
35
35
|
* @prop export let defaultClass: string = 'flex flex-wrap space-x-2 rtl:space-x-reverse';
|
|
36
36
|
* @prop export let contentClass: string = 'p-4 bg-gray-50 rounded-lg dark:bg-gray-800 mt-4';
|
|
37
37
|
* @prop export let divider: boolean = true;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flowbite-svelte",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.46.0",
|
|
4
4
|
"description": "Flowbite components for Svelte",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"packageManager": "pnpm@8.15.4",
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"@changesets/cli": "^2.27.1",
|
|
17
|
+
"@docsearch/css": "3",
|
|
17
18
|
"@docsearch/js": "^3.6.0",
|
|
18
19
|
"@playwright/test": "^1.43.1",
|
|
19
20
|
"@sveltejs/adapter-vercel": "^5.3.0",
|