flowbite-svelte 2.0.0-next.0 → 2.0.0-next.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/accordion/theme.js +1 -1
- package/dist/command-palette/CommandPalette.svelte +1 -1
- package/dist/command-palette/CommandPalette.svelte.d.ts +1 -1
- package/dist/forms/floating-label/FloatingLabelInput.svelte +6 -3
- package/dist/gallery/Gallery.svelte +4 -12
- package/dist/gallery/Gallery.svelte.d.ts +0 -1
- package/dist/gallery/theme.js +1 -1
- package/dist/indicator/Indicator.svelte +1 -1
- package/dist/indicator/Indicator.svelte.d.ts +1 -1
- package/dist/kanban/KanbanCard.svelte +1 -1
- package/dist/kanban/KanbanCard.svelte.d.ts +1 -1
- package/dist/kbd/Kbd.svelte +1 -1
- package/dist/kbd/Kbd.svelte.d.ts +1 -1
- package/dist/list-group/Listgroup.svelte +20 -8
- package/dist/list-group/Listgroup.svelte.d.ts +2 -3
- package/dist/list-group/ListgroupItem.svelte +14 -10
- package/dist/list-group/ListgroupItem.svelte.d.ts +4 -2
- package/dist/list-group/theme.d.ts +87 -29
- package/dist/list-group/theme.js +17 -18
- package/dist/mega-menu/MegaMenu.svelte +7 -16
- package/dist/mega-menu/MegaMenu.svelte.d.ts +1 -3
- package/dist/modal/Modal.svelte +7 -22
- package/dist/modal/Modal.svelte.d.ts +1 -5
- package/dist/modal/theme.d.ts +1 -0
- package/dist/modal/theme.js +2 -1
- package/dist/navbar/Menu.svelte +3 -4
- package/dist/navbar/Menu.svelte.d.ts +1 -2
- package/dist/navbar/NavBrand.svelte +1 -1
- package/dist/navbar/NavBrand.svelte.d.ts +1 -1
- package/dist/navbar/NavContainer.svelte +1 -1
- package/dist/navbar/NavContainer.svelte.d.ts +1 -1
- package/dist/navbar/NavHamburger.svelte +10 -16
- package/dist/navbar/NavHamburger.svelte.d.ts +1 -3
- package/dist/navbar/NavLi.svelte +8 -4
- package/dist/navbar/NavLi.svelte.d.ts +1 -1
- package/dist/navbar/NavUl.svelte +14 -31
- package/dist/navbar/NavUl.svelte.d.ts +1 -4
- package/dist/navbar/Navbar.svelte +9 -5
- package/dist/navbar/Navbar.svelte.d.ts +2 -2
- package/dist/navbar/index.d.ts +1 -0
- package/dist/navbar/index.js +1 -0
- package/dist/navbar/theme.d.ts +32 -1
- package/dist/navbar/theme.js +4 -1
- package/dist/pagination/Pagination.svelte +1 -1
- package/dist/pagination/Pagination.svelte.d.ts +1 -1
- package/dist/pagination/PaginationButton.svelte +1 -1
- package/dist/pagination/PaginationButton.svelte.d.ts +1 -1
- package/dist/pagination/PaginationItem.svelte +1 -1
- package/dist/pagination/PaginationItem.svelte.d.ts +1 -1
- package/dist/pagination/PaginationNav.svelte +10 -25
- package/dist/pagination/PaginationNav.svelte.d.ts +1 -5
- package/dist/popover/Popover.svelte +6 -15
- package/dist/popover/Popover.svelte.d.ts +1 -2
- package/dist/progress/Progressbar.svelte +1 -1
- package/dist/progress/Progressbar.svelte.d.ts +1 -1
- package/dist/progress/Progressradial.svelte +1 -1
- package/dist/progress/Progressradial.svelte.d.ts +1 -1
- package/dist/rating/AdvancedRating.svelte +8 -27
- package/dist/rating/AdvancedRating.svelte.d.ts +1 -6
- package/dist/rating/CustomIcon.svelte +4 -4
- package/dist/rating/CustomIcon.svelte.d.ts +2 -2
- package/dist/rating/Heart.svelte +4 -4
- package/dist/rating/Heart.svelte.d.ts +2 -2
- package/dist/rating/Rating.svelte +5 -13
- package/dist/rating/Rating.svelte.d.ts +1 -2
- package/dist/rating/RatingComment.svelte +1 -1
- package/dist/rating/RatingComment.svelte.d.ts +1 -1
- package/dist/rating/Review.svelte +13 -37
- package/dist/rating/Review.svelte.d.ts +1 -8
- package/dist/rating/ScoreRating.svelte +9 -8
- package/dist/rating/ScoreRating.svelte.d.ts +1 -1
- package/dist/rating/Star.svelte +4 -4
- package/dist/rating/Star.svelte.d.ts +2 -2
- package/dist/rating/Thumbup.svelte +4 -4
- package/dist/rating/Thumbup.svelte.d.ts +2 -2
- package/dist/scroll-spy/ScrollSpy.svelte +1 -1
- package/dist/scroll-spy/ScrollSpy.svelte.d.ts +1 -1
- package/dist/sidebar/Sidebar.svelte +9 -31
- package/dist/sidebar/Sidebar.svelte.d.ts +1 -5
- package/dist/sidebar/SidebarBrand.svelte +6 -20
- package/dist/sidebar/SidebarBrand.svelte.d.ts +1 -3
- package/dist/sidebar/SidebarButton.svelte +3 -2
- package/dist/sidebar/SidebarButton.svelte.d.ts +1 -1
- package/dist/sidebar/SidebarCta.svelte +6 -20
- package/dist/sidebar/SidebarCta.svelte.d.ts +1 -3
- package/dist/sidebar/SidebarDropdownWrapper.svelte +9 -44
- package/dist/sidebar/SidebarDropdownWrapper.svelte.d.ts +1 -5
- package/dist/sidebar/SidebarGroup.svelte +3 -4
- package/dist/sidebar/SidebarGroup.svelte.d.ts +1 -2
- package/dist/sidebar/SidebarItem.svelte +12 -10
- package/dist/sidebar/SidebarItem.svelte.d.ts +2 -5
- package/dist/sidebar/index.d.ts +1 -1
- package/dist/sidebar/index.js +1 -1
- package/dist/sidebar/theme.d.ts +41 -0
- package/dist/sidebar/theme.js +23 -3
- package/dist/skeleton/CardPlaceholder.svelte +1 -1
- package/dist/skeleton/CardPlaceholder.svelte.d.ts +1 -1
- package/dist/skeleton/ImagePlaceholder.svelte +1 -1
- package/dist/skeleton/ImagePlaceholder.svelte.d.ts +1 -1
- package/dist/skeleton/ListPlaceholder.svelte +1 -1
- package/dist/skeleton/ListPlaceholder.svelte.d.ts +1 -1
- package/dist/skeleton/Skeleton.svelte +1 -1
- package/dist/skeleton/Skeleton.svelte.d.ts +1 -1
- package/dist/skeleton/TestimonialPlaceholder.svelte +1 -1
- package/dist/skeleton/TestimonialPlaceholder.svelte.d.ts +1 -1
- package/dist/skeleton/TextPlaceholder.svelte +1 -1
- package/dist/skeleton/TextPlaceholder.svelte.d.ts +1 -1
- package/dist/skeleton/VideoPlaceholder.svelte +1 -1
- package/dist/skeleton/VideoPlaceholder.svelte.d.ts +1 -1
- package/dist/skeleton/WidgetPlaceholder.svelte +1 -1
- package/dist/skeleton/WidgetPlaceholder.svelte.d.ts +1 -1
- package/dist/speed-dial/SpeedDial.svelte +1 -1
- package/dist/speed-dial/SpeedDial.svelte.d.ts +1 -1
- package/dist/speed-dial/SpeedDialButton.svelte +1 -1
- package/dist/speed-dial/SpeedDialButton.svelte.d.ts +1 -1
- package/dist/speed-dial/SpeedDialTrigger.svelte +1 -1
- package/dist/speed-dial/SpeedDialTrigger.svelte.d.ts +1 -1
- package/dist/spinner/Spinner.svelte +1 -1
- package/dist/spinner/Spinner.svelte.d.ts +1 -1
- package/dist/split-pane/Divider.svelte +1 -1
- package/dist/split-pane/Divider.svelte.d.ts +1 -1
- package/dist/split-pane/Pane.svelte +1 -1
- package/dist/split-pane/Pane.svelte.d.ts +1 -1
- package/dist/split-pane/SplitPane.svelte +1 -1
- package/dist/split-pane/SplitPane.svelte.d.ts +1 -1
- package/dist/step-indicator/StepIndicator.svelte +1 -1
- package/dist/step-indicator/StepIndicator.svelte.d.ts +1 -1
- package/dist/stepper/BreadcrumbStepper.svelte +1 -1
- package/dist/stepper/BreadcrumbStepper.svelte.d.ts +1 -1
- package/dist/stepper/DetailedStepper.svelte +1 -1
- package/dist/stepper/DetailedStepper.svelte.d.ts +1 -1
- package/dist/stepper/ProgressStepper.svelte +1 -1
- package/dist/stepper/ProgressStepper.svelte.d.ts +1 -1
- package/dist/stepper/Stepper.svelte +1 -1
- package/dist/stepper/Stepper.svelte.d.ts +1 -1
- package/dist/stepper/TimelineStepper.svelte +1 -1
- package/dist/stepper/TimelineStepper.svelte.d.ts +1 -1
- package/dist/stepper/VerticalStepper.svelte +1 -1
- package/dist/stepper/VerticalStepper.svelte.d.ts +1 -1
- package/dist/table/Table.svelte +1 -1
- package/dist/table/Table.svelte.d.ts +1 -1
- package/dist/table/TableBody.svelte +1 -1
- package/dist/table/TableBody.svelte.d.ts +1 -1
- package/dist/table/TableBodyCell.svelte +1 -1
- package/dist/table/TableBodyCell.svelte.d.ts +1 -1
- package/dist/table/TableBodyRow.svelte +1 -1
- package/dist/table/TableBodyRow.svelte.d.ts +1 -1
- package/dist/table/TableHead.svelte +1 -1
- package/dist/table/TableHead.svelte.d.ts +1 -1
- package/dist/table/TableHeadCell.svelte +1 -1
- package/dist/table/TableHeadCell.svelte.d.ts +1 -1
- package/dist/table/TableSearch.svelte +1 -1
- package/dist/table/TableSearch.svelte.d.ts +1 -1
- package/dist/tabs/TabItem.svelte +1 -1
- package/dist/tabs/TabItem.svelte.d.ts +1 -1
- package/dist/tabs/Tabs.svelte +1 -1
- package/dist/tabs/Tabs.svelte.d.ts +1 -1
- package/dist/theme/themes.d.ts +1 -1
- package/dist/theme/themes.js +1 -1
- package/dist/timeline/Activity.svelte +1 -1
- package/dist/timeline/Activity.svelte.d.ts +1 -1
- package/dist/timeline/ActivityItem.svelte +1 -1
- package/dist/timeline/ActivityItem.svelte.d.ts +1 -1
- package/dist/timeline/Group.svelte +1 -1
- package/dist/timeline/Group.svelte.d.ts +1 -1
- package/dist/timeline/GroupItem.svelte +1 -1
- package/dist/timeline/GroupItem.svelte.d.ts +1 -1
- package/dist/timeline/Timeline.svelte +1 -1
- package/dist/timeline/Timeline.svelte.d.ts +1 -1
- package/dist/timeline/TimelineItem.svelte +1 -1
- package/dist/timeline/TimelineItem.svelte.d.ts +1 -1
- package/dist/toast/Toast.svelte +1 -1
- package/dist/toast/Toast.svelte.d.ts +1 -1
- package/dist/toast/ToastContainer.svelte +1 -1
- package/dist/toast/ToastContainer.svelte.d.ts +1 -1
- package/dist/toolbar/Toolbar.svelte +1 -1
- package/dist/toolbar/Toolbar.svelte.d.ts +1 -1
- package/dist/toolbar/ToolbarButton.svelte +5 -4
- package/dist/toolbar/ToolbarButton.svelte.d.ts +2 -1
- package/dist/toolbar/ToolbarGroup.svelte +1 -1
- package/dist/toolbar/ToolbarGroup.svelte.d.ts +1 -1
- package/dist/toolbar/theme.js +1 -1
- package/dist/tooltip/Tooltip.svelte +1 -1
- package/dist/tooltip/Tooltip.svelte.d.ts +1 -1
- package/dist/types.d.ts +9 -62
- package/dist/typography/a/A.svelte +1 -1
- package/dist/typography/a/A.svelte.d.ts +1 -1
- package/dist/typography/blockquote/Blockquote.svelte +1 -1
- package/dist/typography/blockquote/Blockquote.svelte.d.ts +1 -1
- package/dist/typography/descriptionlist/DescriptionList.svelte +1 -1
- package/dist/typography/descriptionlist/DescriptionList.svelte.d.ts +1 -1
- package/dist/typography/heading/Heading.svelte +1 -1
- package/dist/typography/heading/Heading.svelte.d.ts +1 -1
- package/dist/typography/img/Img.svelte +1 -1
- package/dist/typography/img/Img.svelte.d.ts +1 -1
- package/dist/typography/layout/Layout.svelte +1 -1
- package/dist/typography/layout/Layout.svelte.d.ts +1 -1
- package/dist/typography/list/Li.svelte +1 -1
- package/dist/typography/list/Li.svelte.d.ts +1 -1
- package/dist/typography/list/List.svelte +1 -1
- package/dist/typography/list/List.svelte.d.ts +1 -1
- package/dist/typography/mark/Mark.svelte +1 -1
- package/dist/typography/mark/Mark.svelte.d.ts +1 -1
- package/dist/typography/paragraph/P.svelte +1 -1
- package/dist/typography/paragraph/P.svelte.d.ts +1 -1
- package/dist/typography/secondary/Secondary.svelte +1 -1
- package/dist/typography/secondary/Secondary.svelte.d.ts +1 -1
- package/dist/typography/span/Span.svelte +1 -1
- package/dist/typography/span/Span.svelte.d.ts +1 -1
- package/dist/utils/Arrow.svelte +1 -1
- package/dist/utils/Arrow.svelte.d.ts +1 -1
- package/dist/utils/Popper.svelte +1 -1
- package/dist/utils/Popper.svelte.d.ts +1 -1
- package/dist/video/Video.svelte +1 -1
- package/dist/video/Video.svelte.d.ts +1 -1
- package/package.json +8 -7
package/dist/accordion/theme.js
CHANGED
|
@@ -39,7 +39,7 @@ export const accordionItem = tv({
|
|
|
39
39
|
content: "py-5 border-b border-default text-body"
|
|
40
40
|
},
|
|
41
41
|
false: {
|
|
42
|
-
button: "
|
|
42
|
+
button: "hover:text-heading hover:bg-neutral-secondary-medium",
|
|
43
43
|
contentWrapper: "border border-s-0 border-e-0 border-t-0 border-b-default",
|
|
44
44
|
content: "p-4 md:p-5"
|
|
45
45
|
}
|
|
@@ -194,7 +194,7 @@
|
|
|
194
194
|
@component
|
|
195
195
|
[Go to docs](https://flowbite-svelte.com/)
|
|
196
196
|
## Type
|
|
197
|
-
[CommandPaletteProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
197
|
+
[CommandPaletteProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L2202)
|
|
198
198
|
## Props
|
|
199
199
|
@prop open = $bindable(false)
|
|
200
200
|
@prop items = []
|
|
@@ -2,7 +2,7 @@ import type { CommandPaletteProps } from "../types";
|
|
|
2
2
|
/**
|
|
3
3
|
* [Go to docs](https://flowbite-svelte.com/)
|
|
4
4
|
* ## Type
|
|
5
|
-
* [CommandPaletteProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
5
|
+
* [CommandPaletteProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L2202)
|
|
6
6
|
* ## Props
|
|
7
7
|
* @prop open = $bindable(false)
|
|
8
8
|
* @prop items = []
|
|
@@ -35,7 +35,10 @@
|
|
|
35
35
|
|
|
36
36
|
const { base, input, label, close, combo } = $derived(floatingLabelInput({ variant, size, validation, disabled, withIcon }));
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
// Track if clear button should be shown
|
|
39
|
+
const showClearButton = $derived(clearable && value !== undefined && value !== "");
|
|
40
|
+
|
|
41
|
+
const clearAll = (_event?: MouseEvent) => {
|
|
39
42
|
if (elementRef) {
|
|
40
43
|
elementRef.value = "";
|
|
41
44
|
value = "";
|
|
@@ -177,8 +180,8 @@
|
|
|
177
180
|
onblur={handleBlur}
|
|
178
181
|
onkeydown={handleKeydown}
|
|
179
182
|
/>
|
|
180
|
-
{#if
|
|
181
|
-
<CloseButton class={close({ class: clsx(theme?.close, styling?.close) })} color={clearableColor}
|
|
183
|
+
{#if showClearButton}
|
|
184
|
+
<CloseButton class={close({ class: clsx(theme?.close, styling?.close) })} color={clearableColor} ariaLabel="Clear search value" svgClass={clsx(styling?.svg)} />
|
|
182
185
|
{/if}
|
|
183
186
|
<label for={id} class={label({ class: clsx(theme?.label, styling?.label) })}>
|
|
184
187
|
{@render children()}
|
|
@@ -2,18 +2,11 @@
|
|
|
2
2
|
import { gallery } from "./theme";
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import type { GalleryProps, ImgType } from "..";
|
|
5
|
-
import { getTheme
|
|
6
|
-
import { untrack } from "svelte";
|
|
5
|
+
import { getTheme } from "../theme/themeUtils";
|
|
7
6
|
|
|
8
|
-
let { children, figure, items = [],
|
|
7
|
+
let { children, figure, items = [], class: className, classes, ...restProps }: GalleryProps = $props();
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
"Gallery",
|
|
12
|
-
untrack(() => ({ imgClass })),
|
|
13
|
-
{ imgClass: "image" }
|
|
14
|
-
);
|
|
15
|
-
|
|
16
|
-
const styling = $derived(classes ?? { image: imgClass });
|
|
9
|
+
const styling = $derived(classes);
|
|
17
10
|
|
|
18
11
|
const theme = $derived(getTheme("gallery"));
|
|
19
12
|
|
|
@@ -26,7 +19,7 @@
|
|
|
26
19
|
|
|
27
20
|
{#snippet _figure(item: ImgType)}
|
|
28
21
|
<div>
|
|
29
|
-
<img src={item.src} alt={item.alt} class={image({ class: clsx(theme?.image, styling
|
|
22
|
+
<img src={item.src} alt={item.alt} class={image({ class: clsx(theme?.image, styling?.image) })} {...restProps} />
|
|
30
23
|
</div>
|
|
31
24
|
{/snippet}
|
|
32
25
|
|
|
@@ -53,7 +46,6 @@
|
|
|
53
46
|
@prop children
|
|
54
47
|
@prop figure
|
|
55
48
|
@prop items = []
|
|
56
|
-
@prop imgClass
|
|
57
49
|
@prop class: className
|
|
58
50
|
@prop classes
|
|
59
51
|
@prop ...restProps
|
package/dist/gallery/theme.js
CHANGED
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
@component
|
|
34
34
|
[Go to docs](https://flowbite-svelte.com/)
|
|
35
35
|
## Type
|
|
36
|
-
[IndicatorProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
36
|
+
[IndicatorProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1038)
|
|
37
37
|
## Props
|
|
38
38
|
@prop children
|
|
39
39
|
@prop color = "brand"
|
|
@@ -2,7 +2,7 @@ import type { IndicatorProps } from "..";
|
|
|
2
2
|
/**
|
|
3
3
|
* [Go to docs](https://flowbite-svelte.com/)
|
|
4
4
|
* ## Type
|
|
5
|
-
* [IndicatorProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
5
|
+
* [IndicatorProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1038)
|
|
6
6
|
* ## Props
|
|
7
7
|
* @prop children
|
|
8
8
|
* @prop color = "brand"
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
@component
|
|
48
48
|
[Go to docs](https://flowbite-svelte.com/)
|
|
49
49
|
## Type
|
|
50
|
-
[KanbanCardProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
50
|
+
[KanbanCardProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L2119)
|
|
51
51
|
## Props
|
|
52
52
|
@prop card
|
|
53
53
|
@prop isDragging = false
|
|
@@ -2,7 +2,7 @@ import type { KanbanCardProps } from "../types";
|
|
|
2
2
|
/**
|
|
3
3
|
* [Go to docs](https://flowbite-svelte.com/)
|
|
4
4
|
* ## Type
|
|
5
|
-
* [KanbanCardProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
5
|
+
* [KanbanCardProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L2119)
|
|
6
6
|
* ## Props
|
|
7
7
|
* @prop card
|
|
8
8
|
* @prop isDragging = false
|
package/dist/kbd/Kbd.svelte
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
@component
|
|
20
20
|
[Go to docs](https://flowbite-svelte.com/)
|
|
21
21
|
## Type
|
|
22
|
-
[KbdProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
22
|
+
[KbdProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1049)
|
|
23
23
|
## Props
|
|
24
24
|
@prop children
|
|
25
25
|
@prop class: className
|
package/dist/kbd/Kbd.svelte.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { KbdProps } from "..";
|
|
|
2
2
|
/**
|
|
3
3
|
* [Go to docs](https://flowbite-svelte.com/)
|
|
4
4
|
* ## Type
|
|
5
|
-
* [KbdProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
5
|
+
* [KbdProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1049)
|
|
6
6
|
* ## Props
|
|
7
7
|
* @prop children
|
|
8
8
|
* @prop class: className
|
|
@@ -6,14 +6,17 @@
|
|
|
6
6
|
import { getTheme } from "../theme/themeUtils";
|
|
7
7
|
import { setListGroupContext } from "../context";
|
|
8
8
|
|
|
9
|
-
let { children, items, active, onclick, horizontal, rounded, border, class: className,
|
|
9
|
+
let { children, items, active, onclick, horizontal, rounded, border, class: className, classes, ...restProps }: ListgroupProps = $props();
|
|
10
10
|
|
|
11
|
+
const styling = $derived(classes);
|
|
11
12
|
const theme = $derived(getTheme("listGroup"));
|
|
12
13
|
|
|
13
|
-
const base = $derived(listGroup({ rounded, border, horizontal
|
|
14
|
+
const { base, item: listItem, icon: listIcon } = $derived(listGroup({ rounded, border, horizontal }));
|
|
14
15
|
|
|
15
16
|
let tag = $derived(active ? "div" : "ul");
|
|
16
17
|
|
|
18
|
+
let listIconCls = $derived(listIcon({ class: clsx(theme?.icon, styling?.icon) }));
|
|
19
|
+
|
|
17
20
|
// Create reactive context using getters
|
|
18
21
|
const context = {
|
|
19
22
|
get active() {
|
|
@@ -35,15 +38,25 @@
|
|
|
35
38
|
}
|
|
36
39
|
</script>
|
|
37
40
|
|
|
38
|
-
<svelte:element this={tag} {...restProps} class={base}>
|
|
41
|
+
<svelte:element this={tag} {...restProps} class={base({ class: clsx(theme?.base, className) })}>
|
|
39
42
|
{#if items?.length}
|
|
40
43
|
{#each items as item, i (i)}
|
|
41
44
|
{#if children}
|
|
42
45
|
{@render children(item)}
|
|
43
46
|
{:else if typeof item === "string"}
|
|
44
|
-
<ListgroupItem href={undefined} class={clsx(
|
|
47
|
+
<ListgroupItem href={undefined} class={listItem({ class: clsx(theme?.item, styling?.item) })} classes={{ icon: listIconCls }} {active} {horizontal} onclick={createItemClickHandler()}>
|
|
48
|
+
{item}
|
|
49
|
+
</ListgroupItem>
|
|
45
50
|
{:else}
|
|
46
|
-
<ListgroupItem
|
|
51
|
+
<ListgroupItem
|
|
52
|
+
href={item.href}
|
|
53
|
+
class={listItem({ class: clsx(theme?.item, styling?.item) })}
|
|
54
|
+
classes={{ icon: listIconCls }}
|
|
55
|
+
{active}
|
|
56
|
+
{horizontal}
|
|
57
|
+
{...item}
|
|
58
|
+
onclick={item.onclick ?? createItemClickHandler()}
|
|
59
|
+
/>
|
|
47
60
|
{/if}
|
|
48
61
|
{/each}
|
|
49
62
|
{:else}
|
|
@@ -55,7 +68,7 @@
|
|
|
55
68
|
@component
|
|
56
69
|
[Go to docs](https://flowbite-svelte.com/)
|
|
57
70
|
## Type
|
|
58
|
-
[ListgroupProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
71
|
+
[ListgroupProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1068)
|
|
59
72
|
## Props
|
|
60
73
|
@prop children
|
|
61
74
|
@prop items
|
|
@@ -65,7 +78,6 @@
|
|
|
65
78
|
@prop rounded
|
|
66
79
|
@prop border
|
|
67
80
|
@prop class: className
|
|
68
|
-
@prop
|
|
69
|
-
@prop iconClass
|
|
81
|
+
@prop classes
|
|
70
82
|
@prop ...restProps
|
|
71
83
|
-->
|
|
@@ -2,7 +2,7 @@ import type { ListgroupProps } from "..";
|
|
|
2
2
|
/**
|
|
3
3
|
* [Go to docs](https://flowbite-svelte.com/)
|
|
4
4
|
* ## Type
|
|
5
|
-
* [ListgroupProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
5
|
+
* [ListgroupProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1068)
|
|
6
6
|
* ## Props
|
|
7
7
|
* @prop children
|
|
8
8
|
* @prop items
|
|
@@ -12,8 +12,7 @@ import type { ListgroupProps } from "..";
|
|
|
12
12
|
* @prop rounded
|
|
13
13
|
* @prop border
|
|
14
14
|
* @prop class: className
|
|
15
|
-
* @prop
|
|
16
|
-
* @prop iconClass
|
|
15
|
+
* @prop classes
|
|
17
16
|
* @prop ...restProps
|
|
18
17
|
*/
|
|
19
18
|
declare const Listgroup: import("svelte").Component<ListgroupProps, {}, "">;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import type { HTMLLiAttributes } from "svelte/elements";
|
|
2
3
|
import clsx from "clsx";
|
|
3
4
|
import type { ListgroupItemProps } from "..";
|
|
4
5
|
import { listGroupItem, type ListgroupItemVariants } from "./theme";
|
|
5
6
|
import { getTheme } from "../theme/themeUtils";
|
|
6
7
|
import { getListGroupContext } from "../context";
|
|
7
8
|
|
|
8
|
-
let { children, active, current, disabled, horizontal, name, Icon, class: className,
|
|
9
|
+
let { children, active, current, disabled, horizontal, name, Icon, class: className, classes, href, type, ...restProps }: ListgroupItemProps = $props();
|
|
9
10
|
|
|
11
|
+
const styling = $derived(classes);
|
|
10
12
|
const theme = $derived(getTheme("listGroupItem"));
|
|
11
13
|
|
|
12
14
|
const listGroupCtx = getListGroupContext();
|
|
@@ -14,12 +16,12 @@
|
|
|
14
16
|
const finalHorizontal = $derived(horizontal ?? listGroupCtx?.horizontal);
|
|
15
17
|
|
|
16
18
|
let state: ListgroupItemVariants["state"] = $derived(disabled ? "disabled" : current ? "current" : "normal");
|
|
17
|
-
|
|
19
|
+
const { base, icon } = $derived(listGroupItem({ state, active: finalActive, horizontal: finalHorizontal }));
|
|
18
20
|
</script>
|
|
19
21
|
|
|
20
22
|
{#snippet nameOrChildren()}
|
|
21
23
|
{#if Icon}
|
|
22
|
-
<Icon class={clsx(
|
|
24
|
+
<Icon class={icon({ class: clsx(theme?.icon, styling?.icon) })} />
|
|
23
25
|
{/if}
|
|
24
26
|
{#if children}
|
|
25
27
|
{@render children()}
|
|
@@ -28,16 +30,16 @@
|
|
|
28
30
|
{/if}
|
|
29
31
|
{/snippet}
|
|
30
32
|
|
|
31
|
-
{#if
|
|
32
|
-
<li class={
|
|
33
|
+
{#if href === undefined && !active}
|
|
34
|
+
<li {...restProps as HTMLLiAttributes} class={base({ class: clsx(theme?.base, className) })}>
|
|
33
35
|
{@render nameOrChildren()}
|
|
34
36
|
</li>
|
|
35
|
-
{:else if
|
|
36
|
-
<button type="button" {...restProps} class={
|
|
37
|
+
{:else if href === undefined}
|
|
38
|
+
<button type={type ?? "button"} {...restProps} class={base({ class: clsx(theme?.base, className) })} {disabled} aria-current={current}>
|
|
37
39
|
{@render nameOrChildren()}
|
|
38
40
|
</button>
|
|
39
41
|
{:else}
|
|
40
|
-
<a {...restProps} class={
|
|
42
|
+
<a {href} {...restProps} class={base({ class: clsx(theme?.base, className) })} aria-current={current}>
|
|
41
43
|
{@render nameOrChildren()}
|
|
42
44
|
</a>
|
|
43
45
|
{/if}
|
|
@@ -46,7 +48,7 @@
|
|
|
46
48
|
@component
|
|
47
49
|
[Go to docs](https://flowbite-svelte.com/)
|
|
48
50
|
## Type
|
|
49
|
-
[ListgroupItemProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
51
|
+
[ListgroupItemProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1078)
|
|
50
52
|
## Props
|
|
51
53
|
@prop children
|
|
52
54
|
@prop active
|
|
@@ -56,6 +58,8 @@
|
|
|
56
58
|
@prop name
|
|
57
59
|
@prop Icon
|
|
58
60
|
@prop class: className
|
|
59
|
-
@prop
|
|
61
|
+
@prop classes
|
|
62
|
+
@prop href
|
|
63
|
+
@prop type
|
|
60
64
|
@prop ...restProps
|
|
61
65
|
-->
|
|
@@ -2,7 +2,7 @@ import type { ListgroupItemProps } from "..";
|
|
|
2
2
|
/**
|
|
3
3
|
* [Go to docs](https://flowbite-svelte.com/)
|
|
4
4
|
* ## Type
|
|
5
|
-
* [ListgroupItemProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
5
|
+
* [ListgroupItemProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1078)
|
|
6
6
|
* ## Props
|
|
7
7
|
* @prop children
|
|
8
8
|
* @prop active
|
|
@@ -12,7 +12,9 @@ import type { ListgroupItemProps } from "..";
|
|
|
12
12
|
* @prop name
|
|
13
13
|
* @prop Icon
|
|
14
14
|
* @prop class: className
|
|
15
|
-
* @prop
|
|
15
|
+
* @prop classes
|
|
16
|
+
* @prop href
|
|
17
|
+
* @prop type
|
|
16
18
|
* @prop ...restProps
|
|
17
19
|
*/
|
|
18
20
|
declare const ListgroupItem: import("svelte").Component<ListgroupItemProps, {}, "">;
|
|
@@ -1,46 +1,95 @@
|
|
|
1
1
|
import { type VariantProps } from "tailwind-variants";
|
|
2
|
-
|
|
3
|
-
export type
|
|
2
|
+
import type { Classes } from "../theme/themeUtils";
|
|
3
|
+
export type ListgroupVariants = VariantProps<typeof listGroup> & Classes<typeof listGroup>;
|
|
4
|
+
export type ListgroupItemVariants = VariantProps<typeof listGroupItem> & Classes<typeof listGroupItem>;
|
|
4
5
|
export declare const listGroup: import("tailwind-variants").TVReturnType<{
|
|
5
6
|
rounded: {
|
|
6
|
-
true:
|
|
7
|
-
|
|
7
|
+
true: {
|
|
8
|
+
base: string;
|
|
9
|
+
};
|
|
10
|
+
false: {
|
|
11
|
+
base: string;
|
|
12
|
+
};
|
|
8
13
|
};
|
|
9
14
|
border: {
|
|
10
|
-
true:
|
|
11
|
-
|
|
15
|
+
true: {
|
|
16
|
+
base: string;
|
|
17
|
+
};
|
|
18
|
+
false: {
|
|
19
|
+
base: string;
|
|
20
|
+
};
|
|
12
21
|
};
|
|
13
22
|
horizontal: {
|
|
14
|
-
true:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
23
|
+
true: {
|
|
24
|
+
base: string;
|
|
25
|
+
};
|
|
26
|
+
false: {
|
|
27
|
+
base: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
}, {
|
|
31
|
+
base: string;
|
|
32
|
+
item: string;
|
|
33
|
+
icon: string;
|
|
34
|
+
}, undefined, {
|
|
18
35
|
rounded: {
|
|
19
|
-
true:
|
|
20
|
-
|
|
36
|
+
true: {
|
|
37
|
+
base: string;
|
|
38
|
+
};
|
|
39
|
+
false: {
|
|
40
|
+
base: string;
|
|
41
|
+
};
|
|
21
42
|
};
|
|
22
43
|
border: {
|
|
23
|
-
true:
|
|
24
|
-
|
|
44
|
+
true: {
|
|
45
|
+
base: string;
|
|
46
|
+
};
|
|
47
|
+
false: {
|
|
48
|
+
base: string;
|
|
49
|
+
};
|
|
25
50
|
};
|
|
26
51
|
horizontal: {
|
|
27
|
-
true:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
52
|
+
true: {
|
|
53
|
+
base: string;
|
|
54
|
+
};
|
|
55
|
+
false: {
|
|
56
|
+
base: string;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
}, {
|
|
60
|
+
base: string;
|
|
61
|
+
item: string;
|
|
62
|
+
icon: string;
|
|
63
|
+
}, import("tailwind-variants").TVReturnType<{
|
|
31
64
|
rounded: {
|
|
32
|
-
true:
|
|
33
|
-
|
|
65
|
+
true: {
|
|
66
|
+
base: string;
|
|
67
|
+
};
|
|
68
|
+
false: {
|
|
69
|
+
base: string;
|
|
70
|
+
};
|
|
34
71
|
};
|
|
35
72
|
border: {
|
|
36
|
-
true:
|
|
37
|
-
|
|
73
|
+
true: {
|
|
74
|
+
base: string;
|
|
75
|
+
};
|
|
76
|
+
false: {
|
|
77
|
+
base: string;
|
|
78
|
+
};
|
|
38
79
|
};
|
|
39
80
|
horizontal: {
|
|
40
|
-
true:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
81
|
+
true: {
|
|
82
|
+
base: string;
|
|
83
|
+
};
|
|
84
|
+
false: {
|
|
85
|
+
base: string;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
}, {
|
|
89
|
+
base: string;
|
|
90
|
+
item: string;
|
|
91
|
+
icon: string;
|
|
92
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
44
93
|
export declare const listGroupItem: import("tailwind-variants").TVReturnType<{
|
|
45
94
|
state: {
|
|
46
95
|
normal: string;
|
|
@@ -55,7 +104,10 @@ export declare const listGroupItem: import("tailwind-variants").TVReturnType<{
|
|
|
55
104
|
true: string;
|
|
56
105
|
false: string;
|
|
57
106
|
};
|
|
58
|
-
},
|
|
107
|
+
}, {
|
|
108
|
+
base: string;
|
|
109
|
+
icon: string;
|
|
110
|
+
}, undefined, {
|
|
59
111
|
state: {
|
|
60
112
|
normal: string;
|
|
61
113
|
current: string;
|
|
@@ -69,7 +121,10 @@ export declare const listGroupItem: import("tailwind-variants").TVReturnType<{
|
|
|
69
121
|
true: string;
|
|
70
122
|
false: string;
|
|
71
123
|
};
|
|
72
|
-
},
|
|
124
|
+
}, {
|
|
125
|
+
base: string;
|
|
126
|
+
icon: string;
|
|
127
|
+
}, import("tailwind-variants").TVReturnType<{
|
|
73
128
|
state: {
|
|
74
129
|
normal: string;
|
|
75
130
|
current: string;
|
|
@@ -83,4 +138,7 @@ export declare const listGroupItem: import("tailwind-variants").TVReturnType<{
|
|
|
83
138
|
true: string;
|
|
84
139
|
false: string;
|
|
85
140
|
};
|
|
86
|
-
},
|
|
141
|
+
}, {
|
|
142
|
+
base: string;
|
|
143
|
+
icon: string;
|
|
144
|
+
}, undefined, unknown, unknown, undefined>>;
|
package/dist/list-group/theme.js
CHANGED
|
@@ -1,24 +1,28 @@
|
|
|
1
1
|
import { tv } from "tailwind-variants";
|
|
2
2
|
export const listGroup = tv({
|
|
3
|
-
|
|
3
|
+
slots: {
|
|
4
|
+
base: "flex bg-white dark:bg-gray-800 text-gray-500 dark:text-gray-400 divide-gray-200 dark:divide-gray-600",
|
|
5
|
+
item: "",
|
|
6
|
+
icon: ""
|
|
7
|
+
},
|
|
4
8
|
variants: {
|
|
5
9
|
rounded: {
|
|
6
|
-
true: "rounded-lg",
|
|
7
|
-
false: ""
|
|
10
|
+
true: { base: "rounded-lg" },
|
|
11
|
+
false: { base: "" }
|
|
8
12
|
},
|
|
9
13
|
border: {
|
|
10
|
-
true: "border border-gray-200 dark:border-gray-700",
|
|
11
|
-
false: ""
|
|
14
|
+
true: { base: "border border-gray-200 dark:border-gray-700" },
|
|
15
|
+
false: { base: "" }
|
|
12
16
|
},
|
|
13
17
|
horizontal: {
|
|
14
|
-
true: "flex-row divide-x",
|
|
15
|
-
false: "flex-col divide-y"
|
|
18
|
+
true: { base: "flex-row divide-x" },
|
|
19
|
+
false: { base: "flex-col divide-y" }
|
|
16
20
|
}
|
|
17
21
|
},
|
|
18
22
|
compoundVariants: [
|
|
19
23
|
{
|
|
20
24
|
border: true,
|
|
21
|
-
class: "divide-gray-200 dark:divide-gray-700"
|
|
25
|
+
class: { base: "divide-gray-200 dark:divide-gray-700" }
|
|
22
26
|
}
|
|
23
27
|
],
|
|
24
28
|
defaultVariants: {
|
|
@@ -28,12 +32,15 @@ export const listGroup = tv({
|
|
|
28
32
|
}
|
|
29
33
|
});
|
|
30
34
|
export const listGroupItem = tv({
|
|
31
|
-
|
|
35
|
+
slots: {
|
|
36
|
+
base: "py-2 px-4 w-full text-sm font-medium list-none flex items-center text-left gap-2",
|
|
37
|
+
icon: "w-4 h-4 me-1.5"
|
|
38
|
+
},
|
|
32
39
|
variants: {
|
|
33
40
|
state: {
|
|
34
41
|
normal: "",
|
|
35
42
|
current: "text-white bg-primary-700 dark:text-white dark:bg-gray-800",
|
|
36
|
-
disabled: "text-gray-900 bg-gray-100 dark:bg-gray-600 dark:text-gray-400"
|
|
43
|
+
disabled: "text-gray-900 bg-gray-100 dark:bg-gray-600 dark:text-gray-400 opacity-50"
|
|
37
44
|
},
|
|
38
45
|
active: {
|
|
39
46
|
true: "",
|
|
@@ -55,13 +62,5 @@ export const listGroupItem = tv({
|
|
|
55
62
|
state: "normal",
|
|
56
63
|
class: "hover:bg-gray-100 hover:text-primary-700 dark:hover:bg-gray-600 dark:hover:text-white focus:z-40 focus:outline-hidden focus:ring-2 focus:ring-primary-700 focus:text-primary-700 dark:focus:ring-gray-500 dark:focus:text-white"
|
|
57
64
|
}
|
|
58
|
-
// {
|
|
59
|
-
// horizontal: true,
|
|
60
|
-
// class: "focus:first:rounded-s-lg focus:last:rounded-e-lg"
|
|
61
|
-
// },
|
|
62
|
-
// {
|
|
63
|
-
// horizontal: false,
|
|
64
|
-
// class: "focus:first:rounded-t-lg focus:last:rounded-b-lg"
|
|
65
|
-
// }
|
|
66
65
|
]
|
|
67
66
|
});
|
|
@@ -3,25 +3,18 @@
|
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import type { MegaMenuProps } from "..";
|
|
5
5
|
import Popper from "../utils/Popper.svelte";
|
|
6
|
-
import { getTheme
|
|
7
|
-
import { untrack } from "svelte";
|
|
6
|
+
import { getTheme } from "../theme/themeUtils";
|
|
8
7
|
|
|
9
|
-
let { children, extra, items = [], full,
|
|
8
|
+
let { children, extra, items = [], full, isOpen = $bindable(false), class: className, classes, ...restProps }: MegaMenuProps = $props();
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
"MegaMenu",
|
|
13
|
-
untrack(() => ({ ulClass, extraClass })),
|
|
14
|
-
{ ulClass: "ul", extraClass: "extra" }
|
|
15
|
-
);
|
|
16
|
-
|
|
17
|
-
const styling = $derived(classes ?? { ul: ulClass, extra: extraClass });
|
|
10
|
+
const styling = $derived(classes);
|
|
18
11
|
const theme = $derived(getTheme("megamenu"));
|
|
19
12
|
const { base, div, ul, extra: extraCls } = $derived(megamenu({ full, hasExtra: !!extra }));
|
|
20
13
|
</script>
|
|
21
14
|
|
|
22
15
|
<Popper arrow={false} bind:isOpen trigger="click" placement="bottom" yOnly={full} {...restProps} class={base({ class: clsx(theme?.base, className) })}>
|
|
23
|
-
<div class={div({ class: clsx(theme?.div,
|
|
24
|
-
<ul class={ul({ class: clsx(theme?.ul, styling
|
|
16
|
+
<div class={div({ class: clsx(theme?.div, styling?.div) })}>
|
|
17
|
+
<ul class={ul({ class: clsx(theme?.ul, styling?.ul) })}>
|
|
25
18
|
{#each items as item, index (item.name)}
|
|
26
19
|
<li>
|
|
27
20
|
{@render children({ item, index })}
|
|
@@ -30,7 +23,7 @@
|
|
|
30
23
|
{@render children({ item: items[0], index: 0 })}
|
|
31
24
|
{/each}
|
|
32
25
|
</ul>
|
|
33
|
-
{#if full && extra}<div class={extraCls({ class: clsx(theme?.extra, styling
|
|
26
|
+
{#if full && extra}<div class={extraCls({ class: clsx(theme?.extra, styling?.extra) })}>{@render extra()}</div>{/if}
|
|
34
27
|
</div>
|
|
35
28
|
</Popper>
|
|
36
29
|
|
|
@@ -38,16 +31,14 @@
|
|
|
38
31
|
@component
|
|
39
32
|
[Go to docs](https://flowbite-svelte.com/)
|
|
40
33
|
## Type
|
|
41
|
-
[MegaMenuProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
34
|
+
[MegaMenuProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1088)
|
|
42
35
|
## Props
|
|
43
36
|
@prop children
|
|
44
37
|
@prop extra
|
|
45
38
|
@prop items = []
|
|
46
39
|
@prop full
|
|
47
|
-
@prop ulClass
|
|
48
40
|
@prop isOpen = $bindable(false)
|
|
49
41
|
@prop class: className
|
|
50
|
-
@prop extraClass
|
|
51
42
|
@prop classes
|
|
52
43
|
@prop ...restProps
|
|
53
44
|
-->
|
|
@@ -2,16 +2,14 @@ import type { MegaMenuProps } from "..";
|
|
|
2
2
|
/**
|
|
3
3
|
* [Go to docs](https://flowbite-svelte.com/)
|
|
4
4
|
* ## Type
|
|
5
|
-
* [MegaMenuProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
5
|
+
* [MegaMenuProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1088)
|
|
6
6
|
* ## Props
|
|
7
7
|
* @prop children
|
|
8
8
|
* @prop extra
|
|
9
9
|
* @prop items = []
|
|
10
10
|
* @prop full
|
|
11
|
-
* @prop ulClass
|
|
12
11
|
* @prop isOpen = $bindable(false)
|
|
13
12
|
* @prop class: className
|
|
14
|
-
* @prop extraClass
|
|
15
13
|
* @prop classes
|
|
16
14
|
* @prop ...restProps
|
|
17
15
|
*/
|