flowbite-svelte 1.32.0 → 1.33.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.
- package/dist/alert/Alert.svelte +4 -2
- package/dist/alert/Alert.svelte.d.ts +1 -0
- package/dist/badge/Badge.svelte +4 -2
- package/dist/badge/Badge.svelte.d.ts +1 -0
- package/dist/banner/Banner.svelte +3 -1
- package/dist/banner/Banner.svelte.d.ts +1 -0
- package/dist/context.d.ts +7 -1
- package/dist/navbar/NavHamburger.svelte +2 -2
- package/dist/navbar/NavLi.svelte +2 -2
- package/dist/navbar/NavUl.svelte +2 -2
- package/dist/navbar/Navbar.svelte +6 -1
- package/dist/speed-dial/SpeedDial.svelte +13 -3
- package/dist/table/TableSearch.svelte +15 -9
- package/dist/table/TableSearch.svelte.d.ts +1 -0
- package/dist/toast/Toast.svelte +3 -1
- package/dist/toast/Toast.svelte.d.ts +1 -0
- package/dist/types.d.ts +5 -0
- package/package.json +1 -1
package/dist/alert/Alert.svelte
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
icon,
|
|
13
13
|
alertStatus = $bindable(true),
|
|
14
14
|
closeIcon: CloseIcon,
|
|
15
|
+
closeAriaLabel = "Remove alert",
|
|
15
16
|
color = "primary",
|
|
16
17
|
rounded = true,
|
|
17
18
|
border,
|
|
@@ -63,11 +64,11 @@
|
|
|
63
64
|
|
|
64
65
|
{#if dismissable}
|
|
65
66
|
{#if CloseIcon}
|
|
66
|
-
<CloseButton class="-my-1.5 ms-auto -me-1.5" {color} ariaLabel=
|
|
67
|
+
<CloseButton class="-my-1.5 ms-auto -me-1.5" {color} ariaLabel={closeAriaLabel}>
|
|
67
68
|
<CloseIcon />
|
|
68
69
|
</CloseButton>
|
|
69
70
|
{:else}
|
|
70
|
-
<CloseButton class="-my-1.5 ms-auto -me-1.5" {color} ariaLabel=
|
|
71
|
+
<CloseButton class="-my-1.5 ms-auto -me-1.5" {color} ariaLabel={closeAriaLabel} />
|
|
71
72
|
{/if}
|
|
72
73
|
{/if}
|
|
73
74
|
</div>
|
|
@@ -83,6 +84,7 @@
|
|
|
83
84
|
@prop icon
|
|
84
85
|
@prop alertStatus = $bindable(true)
|
|
85
86
|
@prop closeIcon: CloseIcon
|
|
87
|
+
@prop closeAriaLabel = "Remove alert"
|
|
86
88
|
@prop color = "primary"
|
|
87
89
|
@prop rounded = true
|
|
88
90
|
@prop border
|
package/dist/badge/Badge.svelte
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
color = "primary",
|
|
16
16
|
large = false,
|
|
17
17
|
dismissable = false,
|
|
18
|
+
closeAriaLabel = "Remove badge",
|
|
18
19
|
class: className,
|
|
19
20
|
classes,
|
|
20
21
|
border,
|
|
@@ -63,11 +64,11 @@
|
|
|
63
64
|
|
|
64
65
|
{#if dismissable}
|
|
65
66
|
{#if icon}
|
|
66
|
-
<CloseButton class="ms-1.5 -me-1.5" {color} size={large ? "sm" : "xs"} ariaLabel=
|
|
67
|
+
<CloseButton class="ms-1.5 -me-1.5" {color} size={large ? "sm" : "xs"} ariaLabel={closeAriaLabel}>
|
|
67
68
|
{@render icon()}
|
|
68
69
|
</CloseButton>
|
|
69
70
|
{:else}
|
|
70
|
-
<CloseButton class="ms-1.5 -me-1.5" {color} size={large ? "sm" : "xs"} ariaLabel=
|
|
71
|
+
<CloseButton class="ms-1.5 -me-1.5" {color} size={large ? "sm" : "xs"} ariaLabel={closeAriaLabel} />
|
|
71
72
|
{/if}
|
|
72
73
|
{/if}
|
|
73
74
|
</div>
|
|
@@ -85,6 +86,7 @@
|
|
|
85
86
|
@prop color = "primary"
|
|
86
87
|
@prop large = false
|
|
87
88
|
@prop dismissable = false
|
|
89
|
+
@prop closeAriaLabel = "Remove badge"
|
|
88
90
|
@prop class: className
|
|
89
91
|
@prop classes
|
|
90
92
|
@prop border
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
header,
|
|
14
14
|
open = $bindable(true),
|
|
15
15
|
dismissable = true,
|
|
16
|
+
closeAriaLabel = "Remove banner",
|
|
16
17
|
color = "gray",
|
|
17
18
|
type,
|
|
18
19
|
class: className,
|
|
@@ -56,7 +57,7 @@
|
|
|
56
57
|
|
|
57
58
|
{#if dismissable}
|
|
58
59
|
<div class="flex items-center justify-end">
|
|
59
|
-
<CloseButton class={dismissableClass({ class: clsx(theme?.dismissable, styling.dismissable) })} {color} ariaLabel=
|
|
60
|
+
<CloseButton class={dismissableClass({ class: clsx(theme?.dismissable, styling.dismissable) })} {color} ariaLabel={closeAriaLabel} />
|
|
60
61
|
</div>
|
|
61
62
|
{/if}
|
|
62
63
|
</div>
|
|
@@ -72,6 +73,7 @@
|
|
|
72
73
|
@prop header
|
|
73
74
|
@prop open = $bindable(true)
|
|
74
75
|
@prop dismissable = true
|
|
76
|
+
@prop closeAriaLabel = "Remove banner"
|
|
75
77
|
@prop color = "gray"
|
|
76
78
|
@prop type
|
|
77
79
|
@prop class: className
|
package/dist/context.d.ts
CHANGED
|
@@ -30,7 +30,13 @@ declare const getButtonGroupContext: () => ButtonGroupContextType | undefined, s
|
|
|
30
30
|
export { getButtonGroupContext, setButtonGroupContext };
|
|
31
31
|
declare const getNavbarStateContext: () => NavbarState | undefined, setNavbarStateContext: (context: NavbarState) => NavbarState;
|
|
32
32
|
export { getNavbarStateContext, setNavbarStateContext };
|
|
33
|
-
declare const getNavbarBreakpointContext: () =>
|
|
33
|
+
declare const getNavbarBreakpointContext: () => {
|
|
34
|
+
value: NavbarBreakpoint;
|
|
35
|
+
} | undefined, setNavbarBreakpointContext: (context: {
|
|
36
|
+
value: NavbarBreakpoint;
|
|
37
|
+
}) => {
|
|
38
|
+
value: NavbarBreakpoint;
|
|
39
|
+
};
|
|
34
40
|
export { getNavbarBreakpointContext, setNavbarBreakpointContext };
|
|
35
41
|
declare const getSidebarContext: () => SidebarContextType | undefined, setSidebarContext: (context: SidebarContextType) => SidebarContextType;
|
|
36
42
|
export { getSidebarContext, setSidebarContext };
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
|
|
22
22
|
const theme = $derived(getTheme("navbarHamburger"));
|
|
23
23
|
const navState = getNavbarStateContext();
|
|
24
|
-
const
|
|
25
|
-
const { base, menu } = navbarHamburger({ breakpoint:
|
|
24
|
+
const navBreakpointCtx = getNavbarBreakpointContext();
|
|
25
|
+
const { base, menu } = $derived(navbarHamburger({ breakpoint: navBreakpointCtx?.value ?? "md" }));
|
|
26
26
|
|
|
27
27
|
const toggle: MouseEventHandler<HTMLButtonElement> = () => {
|
|
28
28
|
if (!navState) return;
|
package/dist/navbar/NavLi.svelte
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { getNavbarStateContext, getNavbarBreakpointContext } from "../context";
|
|
7
7
|
|
|
8
8
|
let navState = getNavbarStateContext();
|
|
9
|
-
let
|
|
9
|
+
let navBreakpointCtx = getNavbarBreakpointContext();
|
|
10
10
|
|
|
11
11
|
let { children, onclick, activeClass, nonActiveClass, class: className, ...restProps }: NavLiProps = $props();
|
|
12
12
|
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
let active = $derived(navState?.activeUrl ? restProps.href === navState.activeUrl : false);
|
|
16
16
|
let liClass = $derived(
|
|
17
17
|
navbarLi({
|
|
18
|
-
breakpoint:
|
|
18
|
+
breakpoint: navBreakpointCtx?.value ?? "md",
|
|
19
19
|
hidden: navState?.hidden ?? true,
|
|
20
20
|
class: clsx(active ? (activeClass ?? navState?.activeClass) : (nonActiveClass ?? navState?.nonActiveClass), theme, className)
|
|
21
21
|
})
|
package/dist/navbar/NavUl.svelte
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
import { untrack } from "svelte";
|
|
11
11
|
|
|
12
12
|
let navState = getNavbarStateContext();
|
|
13
|
-
let
|
|
13
|
+
let navBreakpointCtx = getNavbarBreakpointContext();
|
|
14
14
|
|
|
15
15
|
let {
|
|
16
16
|
children,
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
|
|
61
61
|
let hidden: boolean = $derived(navState?.hidden ?? true);
|
|
62
62
|
|
|
63
|
-
let { base, ul, active, nonActive } = $derived(navbarUl({ hidden, breakpoint:
|
|
63
|
+
let { base, ul, active, nonActive } = $derived(navbarUl({ hidden, breakpoint: navBreakpointCtx?.value ?? "md" }));
|
|
64
64
|
|
|
65
65
|
$effect(() => {
|
|
66
66
|
if (!navState) return;
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
import type { NavbarState, NavbarProps } from "../types";
|
|
6
6
|
import { getTheme } from "../theme/themeUtils";
|
|
7
7
|
import { setNavbarStateContext, setNavbarBreakpointContext } from "../context";
|
|
8
|
+
import type { NavbarBreakpoint } from "../types";
|
|
9
|
+
import { untrack } from "svelte";
|
|
8
10
|
|
|
9
11
|
let { children, fluid, navContainerClass, class: className, closeOnClickOutside = true, breakpoint = "md", ...restProps }: NavbarProps = $props();
|
|
10
12
|
|
|
@@ -13,8 +15,11 @@
|
|
|
13
15
|
let navState = $state<NavbarState>({ hidden: true });
|
|
14
16
|
setNavbarStateContext(navState);
|
|
15
17
|
|
|
18
|
+
let breakpointState = $state<{ value: NavbarBreakpoint }>({ value: untrack(() => breakpoint) });
|
|
19
|
+
setNavbarBreakpointContext(breakpointState);
|
|
20
|
+
|
|
16
21
|
$effect(() => {
|
|
17
|
-
|
|
22
|
+
breakpointState.value = breakpoint;
|
|
18
23
|
});
|
|
19
24
|
|
|
20
25
|
// Add reference to the navbar element
|
|
@@ -35,9 +35,19 @@
|
|
|
35
35
|
|
|
36
36
|
const theme = $derived(getTheme("speedDial"));
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
const speedDialCtx: SpeedCtxType = {
|
|
39
|
+
get pill() {
|
|
40
|
+
return pill;
|
|
41
|
+
},
|
|
42
|
+
get tooltip() {
|
|
43
|
+
return tooltip;
|
|
44
|
+
},
|
|
45
|
+
get textOutside() {
|
|
46
|
+
return textOutside;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
setContext<SpeedCtxType>("speed-dial", speedDialCtx);
|
|
41
51
|
|
|
42
52
|
let vertical: boolean = $derived(getSideAxis(placement) === "y");
|
|
43
53
|
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
class: className,
|
|
26
26
|
classes,
|
|
27
27
|
placeholder = "Search",
|
|
28
|
+
oninput,
|
|
28
29
|
...restProps
|
|
29
30
|
}: TableSearchProps = $props();
|
|
30
31
|
|
|
@@ -57,15 +58,19 @@
|
|
|
57
58
|
// Handle custom color
|
|
58
59
|
const finalTableClass = $derived(color === "custom" && customColor ? clsx(tableCls, customColor) : tableCls);
|
|
59
60
|
|
|
60
|
-
const tableSearchCtx =
|
|
61
|
-
striped
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
const tableSearchCtx: TableContextType = {
|
|
62
|
+
get striped() {
|
|
63
|
+
return striped;
|
|
64
|
+
},
|
|
65
|
+
get hoverable() {
|
|
66
|
+
return hoverable;
|
|
67
|
+
},
|
|
68
|
+
get color() {
|
|
69
|
+
return themeColor;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
65
72
|
|
|
66
|
-
|
|
67
|
-
setTableContext(tableSearchCtx);
|
|
68
|
-
});
|
|
73
|
+
setTableContext(tableSearchCtx);
|
|
69
74
|
</script>
|
|
70
75
|
|
|
71
76
|
<div class={root({ class: clsx(theme?.root, styling.root) })}>
|
|
@@ -77,7 +82,7 @@
|
|
|
77
82
|
<path fill-rule="evenodd" d="M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z" clip-rule="evenodd" />
|
|
78
83
|
</svg>
|
|
79
84
|
</div>
|
|
80
|
-
<input bind:value={inputValue} type="text" id="table-search" class={input({ class: clsx(theme?.input, styling.input) })} {placeholder} />
|
|
85
|
+
<input bind:value={inputValue} type="text" id="table-search" class={input({ class: clsx(theme?.input, styling.input) })} {placeholder} {oninput} />
|
|
81
86
|
</div>
|
|
82
87
|
{#if header}
|
|
83
88
|
{@render header()}
|
|
@@ -117,5 +122,6 @@
|
|
|
117
122
|
@prop class: className
|
|
118
123
|
@prop classes
|
|
119
124
|
@prop placeholder = "Search"
|
|
125
|
+
@prop oninput
|
|
120
126
|
@prop ...restProps
|
|
121
127
|
-->
|
|
@@ -22,6 +22,7 @@ import type { TableSearchProps } from "../types";
|
|
|
22
22
|
* @prop class: className
|
|
23
23
|
* @prop classes
|
|
24
24
|
* @prop placeholder = "Search"
|
|
25
|
+
* @prop oninput
|
|
25
26
|
* @prop ...restProps
|
|
26
27
|
*/
|
|
27
28
|
declare const TableSearch: import("svelte").Component<TableSearchProps, {}, "inputValue">;
|
package/dist/toast/Toast.svelte
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
icon,
|
|
14
14
|
toastStatus = $bindable(true),
|
|
15
15
|
dismissable = true,
|
|
16
|
+
closeAriaLabel = "Remove toast",
|
|
16
17
|
color = "primary",
|
|
17
18
|
position,
|
|
18
19
|
iconClass,
|
|
@@ -69,7 +70,7 @@
|
|
|
69
70
|
</div>
|
|
70
71
|
|
|
71
72
|
{#if dismissable}
|
|
72
|
-
<CloseButton class={close({ class: clsx(theme?.close, classes?.close) })} ariaLabel=
|
|
73
|
+
<CloseButton class={close({ class: clsx(theme?.close, classes?.close) })} ariaLabel={closeAriaLabel} {color} />
|
|
73
74
|
{/if}
|
|
74
75
|
</div>
|
|
75
76
|
{/if}
|
|
@@ -84,6 +85,7 @@
|
|
|
84
85
|
@prop icon
|
|
85
86
|
@prop toastStatus = $bindable(true)
|
|
86
87
|
@prop dismissable = true
|
|
88
|
+
@prop closeAriaLabel = "Remove toast"
|
|
87
89
|
@prop color = "primary"
|
|
88
90
|
@prop position
|
|
89
91
|
@prop iconClass
|
package/dist/types.d.ts
CHANGED
|
@@ -168,6 +168,7 @@ export interface AlertProps extends Omit<AlertVariants, "icon">, Omit<HTMLAttrib
|
|
|
168
168
|
icon?: Snippet;
|
|
169
169
|
alertStatus?: boolean;
|
|
170
170
|
closeIcon?: Component;
|
|
171
|
+
closeAriaLabel?: string;
|
|
171
172
|
transition?: TransitionFunc;
|
|
172
173
|
params?: ParamsType;
|
|
173
174
|
onclick?: () => void;
|
|
@@ -188,6 +189,7 @@ export interface BadgeProps extends BadgeVariants, Omit<HTMLAttributes<HTMLDivEl
|
|
|
188
189
|
badgeStatus?: boolean;
|
|
189
190
|
large?: boolean;
|
|
190
191
|
dismissable?: boolean;
|
|
192
|
+
closeAriaLabel?: string;
|
|
191
193
|
href?: HTMLAnchorAttributes["href"];
|
|
192
194
|
target?: HTMLAnchorAttributes["target"];
|
|
193
195
|
transition?: TransitionFunc;
|
|
@@ -198,6 +200,7 @@ export interface BannerProps extends BannerVariants, Omit<HTMLAttributes<HTMLDiv
|
|
|
198
200
|
header?: Snippet;
|
|
199
201
|
open?: boolean;
|
|
200
202
|
dismissable?: boolean;
|
|
203
|
+
closeAriaLabel?: string;
|
|
201
204
|
innerClass?: ClassValue;
|
|
202
205
|
transition?: TransitionFunc;
|
|
203
206
|
params?: ParamsType;
|
|
@@ -1590,6 +1593,7 @@ export interface TableSearchProps extends TableSearchVariants, HTMLTableAttribut
|
|
|
1590
1593
|
svgClass?: ClassValue;
|
|
1591
1594
|
tableClass?: ClassValue;
|
|
1592
1595
|
placeholder?: string;
|
|
1596
|
+
oninput?: (event: Event) => void;
|
|
1593
1597
|
}
|
|
1594
1598
|
export interface TabsProps extends TabsVaraints, HTMLAttributes<HTMLUListElement> {
|
|
1595
1599
|
children: Snippet;
|
|
@@ -1701,6 +1705,7 @@ export interface ToastProps extends ToastVaraints, HTMLAttributes<HTMLDivElement
|
|
|
1701
1705
|
icon?: Snippet;
|
|
1702
1706
|
toastStatus?: boolean;
|
|
1703
1707
|
dismissable?: boolean;
|
|
1708
|
+
closeAriaLabel?: string;
|
|
1704
1709
|
color?: ToastVaraints["color"];
|
|
1705
1710
|
position?: ToastVaraints["position"];
|
|
1706
1711
|
iconClass?: string;
|