flowbite-svelte 1.10.4 → 1.10.6
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/Accordion.svelte +4 -4
- package/dist/accordion/AccordionItem.svelte +7 -6
- package/dist/accordion/theme.d.ts +3 -2
- package/dist/alert/Alert.svelte +10 -12
- package/dist/alert/theme.d.ts +2 -1
- package/dist/avatar/Avatar.svelte +9 -11
- package/dist/avatar/theme.d.ts +2 -1
- package/dist/badge/Badge.svelte +4 -3
- package/dist/badge/theme.d.ts +2 -1
- package/dist/banner/Banner.svelte +5 -4
- package/dist/banner/theme.d.ts +2 -1
- package/dist/bottom-navigation/BottomNav.svelte +3 -2
- package/dist/bottom-navigation/BottomNavHeader.svelte +4 -3
- package/dist/bottom-navigation/BottomNavHeaderItem.svelte +4 -3
- package/dist/bottom-navigation/BottomNavItem.svelte +4 -3
- package/dist/bottom-navigation/theme.d.ts +5 -4
- package/dist/breadcrumb/Breadcrumb.svelte +4 -3
- package/dist/breadcrumb/BreadcrumbItem.svelte +7 -6
- package/dist/breadcrumb/theme.d.ts +3 -2
- package/dist/button-group/ButtonGroup.svelte +3 -2
- package/dist/button-group/theme.d.ts +2 -1
- package/dist/buttons/Button.svelte +3 -2
- package/dist/buttons/GradientButton.svelte +5 -4
- package/dist/buttons/theme.d.ts +3 -2
- package/dist/card/Card.svelte +4 -4
- package/dist/card/theme.d.ts +2 -1
- package/dist/carousel/Carousel.svelte +5 -4
- package/dist/carousel/CarouselIndicators.svelte +4 -3
- package/dist/carousel/ControlButton.svelte +7 -4
- package/dist/carousel/Controls.svelte +4 -3
- package/dist/carousel/Slide.svelte +3 -2
- package/dist/carousel/Thumbnail.svelte +2 -2
- package/dist/carousel/Thumbnails.svelte +3 -3
- package/dist/carousel/theme.d.ts +20 -9
- package/dist/carousel/theme.js +4 -1
- package/dist/clipboard/Clipboard.svelte +2 -2
- package/dist/clipboard/theme.d.ts +2 -1
- package/dist/darkmode/DarkMode.svelte +3 -2
- package/dist/darkmode/theme.d.ts +2 -1
- package/dist/datepicker/Datepicker.svelte +27 -23
- package/dist/datepicker/theme.d.ts +1 -1
- package/dist/drawer/Drawer.svelte +4 -3
- package/dist/drawer/Drawerhead.svelte +5 -4
- package/dist/drawer/theme.d.ts +3 -2
- package/dist/dropdown/Dropdown.svelte +3 -2
- package/dist/dropdown/DropdownDivider.svelte +3 -2
- package/dist/dropdown/DropdownGroup.svelte +3 -2
- package/dist/dropdown/DropdownHeader.svelte +3 -2
- package/dist/dropdown/DropdownItem.svelte +4 -3
- package/dist/dropdown/theme.d.ts +6 -5
- package/dist/footer/Footer.svelte +4 -3
- package/dist/footer/FooterBrand.svelte +6 -5
- package/dist/footer/FooterCopyright.svelte +5 -4
- package/dist/footer/FooterIcon.svelte +3 -2
- package/dist/footer/FooterLink.svelte +4 -3
- package/dist/footer/FooterLinkGroup.svelte +3 -2
- package/dist/footer/theme.d.ts +7 -6
- package/dist/forms/button-toggle/ButtonToggle.svelte +7 -6
- package/dist/forms/button-toggle/ButtonToggleGroup.svelte +6 -5
- package/dist/forms/button-toggle/CheckIcon.svelte +3 -2
- package/dist/forms/button-toggle/theme.d.ts +5 -4
- package/dist/forms/checkbox/Checkbox.svelte +6 -5
- package/dist/forms/checkbox/CheckboxButton.svelte +3 -2
- package/dist/forms/checkbox/theme.d.ts +3 -2
- package/dist/forms/dropzone/Dropzone.svelte +3 -2
- package/dist/forms/dropzone/theme.d.ts +2 -1
- package/dist/forms/fileupload/Fileupload.svelte +5 -4
- package/dist/forms/fileupload/theme.d.ts +2 -1
- package/dist/forms/floating-label/FloatingLabelInput.svelte +7 -6
- package/dist/forms/floating-label/theme.d.ts +2 -1
- package/dist/forms/helper/Helper.svelte +3 -2
- package/dist/forms/helper/theme.d.ts +2 -1
- package/dist/forms/input-addon/InputAddon.svelte +3 -2
- package/dist/forms/input-field/Input.svelte +11 -10
- package/dist/forms/input-field/theme.d.ts +2 -1
- package/dist/forms/label/Label.svelte +3 -2
- package/dist/forms/label/theme.d.ts +2 -1
- package/dist/forms/phoneinput/PhoneInput.svelte +7 -7
- package/dist/forms/phoneinput/theme.d.ts +1 -1
- package/dist/forms/radio/Radio.svelte +4 -3
- package/dist/forms/radio/RadioButton.svelte +3 -2
- package/dist/forms/radio/theme.d.ts +3 -2
- package/dist/forms/range/Range.svelte +3 -2
- package/dist/forms/range/theme.d.ts +2 -1
- package/dist/forms/search/Search.svelte +8 -7
- package/dist/forms/search/theme.d.ts +2 -1
- package/dist/forms/select/MultiSelect.svelte +7 -6
- package/dist/forms/select/Select.svelte +5 -4
- package/dist/forms/select/theme.d.ts +3 -2
- package/dist/forms/tags/Tags.svelte +7 -6
- package/dist/forms/tags/theme.d.ts +2 -1
- package/dist/forms/textarea/Textarea.svelte +11 -10
- package/dist/forms/textarea/theme.d.ts +2 -1
- package/dist/forms/timepicker/Timepicker.svelte +38 -37
- package/dist/forms/timepicker/theme.d.ts +2 -1
- package/dist/forms/toggle/Toggle.svelte +5 -4
- package/dist/forms/toggle/theme.d.ts +2 -1
- package/dist/gallery/Gallery.svelte +4 -3
- package/dist/gallery/theme.d.ts +2 -1
- package/dist/indicator/Indicator.svelte +5 -3
- package/dist/indicator/theme.d.ts +2 -1
- package/dist/kbd/Kbd.svelte +3 -2
- package/dist/kbd/theme.d.ts +2 -1
- package/dist/list-group/Listgroup.svelte +6 -5
- package/dist/list-group/ListgroupItem.svelte +7 -6
- package/dist/list-group/theme.d.ts +3 -2
- package/dist/mega-menu/MegaMenu.svelte +6 -5
- package/dist/mega-menu/theme.d.ts +2 -1
- package/dist/modal/Modal.svelte +7 -7
- package/dist/modal/theme.d.ts +2 -1
- package/dist/navbar/Menu.svelte +1 -2
- package/dist/navbar/NavBrand.svelte +1 -2
- package/dist/navbar/NavContainer.svelte +1 -2
- package/dist/navbar/NavHamburger.svelte +2 -3
- package/dist/navbar/NavHamburger.svelte.d.ts +1 -2
- package/dist/navbar/NavLi.svelte +1 -2
- package/dist/navbar/NavUl.svelte +4 -5
- package/dist/navbar/Navbar.svelte +2 -2
- package/dist/navbar/theme.d.ts +6 -5
- package/dist/pagination/Pagination.svelte +2 -2
- package/dist/pagination/PaginationButton.svelte +10 -13
- package/dist/pagination/PaginationItem.svelte +1 -2
- package/dist/pagination/PaginationNav.svelte +7 -7
- package/dist/pagination/theme.d.ts +5 -4
- package/dist/popover/Popover.svelte +4 -5
- package/dist/popover/theme.d.ts +2 -1
- package/dist/progress/Progressbar.svelte +6 -7
- package/dist/progress/Progressradial.svelte +7 -8
- package/dist/progress/theme.d.ts +2 -2
- package/dist/rating/AdvancedRating.svelte +5 -6
- package/dist/rating/Rating.svelte +2 -3
- package/dist/rating/Review.svelte +7 -8
- package/dist/rating/ScoreRating.svelte +8 -8
- package/dist/rating/theme.d.ts +5 -4
- package/dist/sidebar/Sidebar.svelte +27 -62
- package/dist/sidebar/SidebarBrand.svelte +3 -4
- package/dist/sidebar/SidebarButton.svelte +1 -2
- package/dist/sidebar/SidebarCta.svelte +3 -4
- package/dist/sidebar/SidebarDropdownWrapper.svelte +6 -7
- package/dist/sidebar/SidebarItem.svelte +5 -4
- package/dist/sidebar/theme.d.ts +12 -23
- package/dist/sidebar/theme.js +6 -45
- package/dist/skeleton/CardPlaceholder.svelte +11 -12
- package/dist/skeleton/ImagePlaceholder.svelte +39 -12
- package/dist/skeleton/ListPlaceholder.svelte +26 -8
- package/dist/skeleton/Skeleton.svelte +24 -9
- package/dist/skeleton/TestimonialPlaceholder.svelte +27 -8
- package/dist/skeleton/TextPlaceholder.svelte +49 -26
- package/dist/skeleton/VideoPlaceholder.svelte +2 -3
- package/dist/skeleton/WidgetPlaceholder.svelte +1 -2
- package/dist/skeleton/theme.d.ts +9 -8
- package/dist/speed-dial/SpeedDial.svelte +3 -3
- package/dist/speed-dial/SpeedDialButton.svelte +3 -3
- package/dist/speed-dial/theme.d.ts +3 -2
- package/dist/spinner/Spinner.svelte +2 -3
- package/dist/spinner/theme.d.ts +2 -1
- package/dist/stepindicator/StepIndicator.svelte +10 -9
- package/dist/stepindicator/theme.d.ts +2 -1
- package/dist/stepper/BreadcrumbStepper.svelte +9 -10
- package/dist/stepper/DetailedStepper.svelte +4 -4
- package/dist/stepper/ProgressStepper.svelte +8 -11
- package/dist/stepper/Stepper.svelte +12 -18
- package/dist/stepper/TimelineStepper.svelte +4 -4
- package/dist/stepper/VerticalStepper.svelte +4 -4
- package/dist/table/Table.svelte +3 -3
- package/dist/table/TableBody.svelte +1 -2
- package/dist/table/TableBodyCell.svelte +1 -2
- package/dist/table/TableBodyRow.svelte +2 -3
- package/dist/table/TableHead.svelte +2 -3
- package/dist/table/TableHeadCell.svelte +1 -2
- package/dist/table/TableSearch.svelte +9 -9
- package/dist/table/theme.d.ts +6 -6
- package/dist/tabs/TabItem.svelte +5 -4
- package/dist/tabs/Tabs.svelte +3 -4
- package/dist/tabs/theme.d.ts +3 -2
- package/dist/timeline/Activity.svelte +1 -2
- package/dist/timeline/ActivityItem.svelte +9 -9
- package/dist/timeline/Group.svelte +4 -4
- package/dist/timeline/GroupItem.svelte +6 -6
- package/dist/timeline/Timeline.svelte +2 -3
- package/dist/timeline/TimelineItem.svelte +7 -7
- package/dist/timeline/theme.d.ts +7 -6
- package/dist/toast/Toast.svelte +5 -5
- package/dist/toast/theme.d.ts +2 -1
- package/dist/toolbar/Toolbar.svelte +2 -3
- package/dist/toolbar/ToolbarButton.svelte +4 -5
- package/dist/toolbar/ToolbarGroup.svelte +2 -3
- package/dist/toolbar/theme.d.ts +4 -3
- package/dist/tooltip/Tooltip.svelte +1 -2
- package/dist/tooltip/theme.d.ts +2 -1
- package/dist/types.d.ts +2 -3
- package/dist/typography/anchor/A.svelte +3 -4
- package/dist/typography/anchor/theme.d.ts +2 -1
- package/dist/typography/blockquote/Blockquote.svelte +3 -4
- package/dist/typography/blockquote/theme.d.ts +2 -1
- package/dist/typography/descriptionlist/DescriptionList.svelte +2 -3
- package/dist/typography/descriptionlist/theme.d.ts +2 -1
- package/dist/typography/heading/Heading.svelte +2 -3
- package/dist/typography/heading/theme.d.ts +2 -1
- package/dist/typography/hr/Hr.svelte +4 -5
- package/dist/typography/hr/theme.d.ts +2 -1
- package/dist/typography/img/EnhancedImg.svelte +4 -5
- package/dist/typography/img/Img.svelte +4 -5
- package/dist/typography/img/theme.d.ts +2 -1
- package/dist/typography/layout/Layout.svelte +2 -3
- package/dist/typography/layout/theme.d.ts +2 -1
- package/dist/typography/list/Li.svelte +1 -2
- package/dist/typography/list/List.svelte +2 -3
- package/dist/typography/list/theme.d.ts +2 -1
- package/dist/typography/mark/Mark.svelte +1 -1
- package/dist/typography/mark/theme.d.ts +2 -1
- package/dist/typography/paragraph/P.svelte +2 -3
- package/dist/typography/paragraph/theme.d.ts +2 -1
- package/dist/typography/secondary/Secondary.svelte +1 -2
- package/dist/typography/secondary/theme.d.ts +2 -1
- package/dist/typography/span/Span.svelte +2 -3
- package/dist/typography/span/theme.d.ts +2 -1
- package/dist/video/Video.svelte +2 -2
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
import { setContext } from "svelte";
|
|
4
4
|
import { paginationNav, type PaginationNavTheme } from "./theme";
|
|
5
|
-
import { type PaginationNavProps, PaginationButton
|
|
5
|
+
import { type PaginationNavProps, PaginationButton } from "..";
|
|
6
6
|
import { getTheme } from "../theme/themeUtils";
|
|
7
7
|
|
|
8
8
|
function paginationRange(start: number, end: number): number[] {
|
|
@@ -58,17 +58,17 @@
|
|
|
58
58
|
|
|
59
59
|
<nav aria-label={ariaLabel} {...restProps}>
|
|
60
60
|
{#if layout === "table"}
|
|
61
|
-
<div class={
|
|
62
|
-
Showing <span class={
|
|
61
|
+
<div class={tableDiv({ class: clsx((theme as PaginationNavTheme)?.tableDiv, tableDivClass) })}>
|
|
62
|
+
Showing <span class={tableSpan({ class: clsx((theme as PaginationNavTheme)?.tableSpan, spanClass) })}>{currentPage}</span>
|
|
63
63
|
of
|
|
64
|
-
<span class={
|
|
64
|
+
<span class={tableSpan({ class: clsx((theme as PaginationNavTheme)?.tableSpan, spanClass) })}>{totalPages}</span>
|
|
65
65
|
Entries
|
|
66
66
|
</div>
|
|
67
67
|
{/if}
|
|
68
68
|
|
|
69
|
-
<ul class={
|
|
69
|
+
<ul class={base({ class: clsx((theme as PaginationNavTheme)?.base, className) })}>
|
|
70
70
|
<li {...restProps}>
|
|
71
|
-
<PaginationButton onclick={goToPreviousPage} disabled={currentPage === 1} class={
|
|
71
|
+
<PaginationButton onclick={goToPreviousPage} disabled={currentPage === 1} class={prevItem({ class: clsx((theme as PaginationNavTheme)?.prevItem, prevClass) })}>
|
|
72
72
|
{#if prevContent}
|
|
73
73
|
{@render prevContent()}
|
|
74
74
|
{:else}
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
{/each}
|
|
87
87
|
{/if}
|
|
88
88
|
<li {...restProps}>
|
|
89
|
-
<PaginationButton onclick={goToNextPage} disabled={currentPage === totalPages} class={
|
|
89
|
+
<PaginationButton onclick={goToNextPage} disabled={currentPage === totalPages} class={nextItem({ class: clsx((theme as PaginationNavTheme)?.nextItem, nextClass) })}>
|
|
90
90
|
{#if nextContent}
|
|
91
91
|
{@render nextContent()}
|
|
92
92
|
{:else}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type VariantProps } from "tailwind-variants";
|
|
2
|
+
import type { ClassValue } from "svelte/elements";
|
|
2
3
|
export type PaginationVariants = VariantProps<typeof pagination>;
|
|
3
4
|
export declare const paginationNav: import("tailwind-variants").TVReturnType<{
|
|
4
5
|
size: {
|
|
@@ -77,7 +78,7 @@ export declare const paginationNav: import("tailwind-variants").TVReturnType<{
|
|
|
77
78
|
nextItem: string;
|
|
78
79
|
}, undefined, unknown, unknown, undefined>>;
|
|
79
80
|
export type PaginationNavSlots = keyof typeof paginationNav.slots;
|
|
80
|
-
export type PaginationNavTheme = Partial<Record<PaginationNavSlots,
|
|
81
|
+
export type PaginationNavTheme = Partial<Record<PaginationNavSlots, ClassValue>>;
|
|
81
82
|
export type PaginationItemVariants = VariantProps<typeof paginationItem>;
|
|
82
83
|
export declare const paginationButton: import("tailwind-variants").TVReturnType<{
|
|
83
84
|
size: {
|
|
@@ -143,7 +144,7 @@ export declare const paginationButton: import("tailwind-variants").TVReturnType<
|
|
|
143
144
|
false: string;
|
|
144
145
|
};
|
|
145
146
|
}, undefined, "flex items-center font-medium", unknown, unknown, undefined>>;
|
|
146
|
-
export type PaginationButtonTheme =
|
|
147
|
+
export type PaginationButtonTheme = ClassValue;
|
|
147
148
|
export declare const paginationItem: import("tailwind-variants").TVReturnType<{
|
|
148
149
|
size: {
|
|
149
150
|
default: string;
|
|
@@ -196,7 +197,7 @@ export declare const paginationItem: import("tailwind-variants").TVReturnType<{
|
|
|
196
197
|
false: string;
|
|
197
198
|
};
|
|
198
199
|
}, undefined, "flex items-center font-medium", unknown, unknown, undefined>>;
|
|
199
|
-
export type PaginationItemTheme =
|
|
200
|
+
export type PaginationItemTheme = ClassValue;
|
|
200
201
|
export declare const pagination: import("tailwind-variants").TVReturnType<{
|
|
201
202
|
table: {
|
|
202
203
|
true: string;
|
|
@@ -225,4 +226,4 @@ export declare const pagination: import("tailwind-variants").TVReturnType<{
|
|
|
225
226
|
large: string;
|
|
226
227
|
};
|
|
227
228
|
}, undefined, "inline-flex -space-x-px rtl:space-x-reverse items-center", unknown, unknown, undefined>>;
|
|
228
|
-
export type PaginationTheme =
|
|
229
|
+
export type PaginationTheme = ClassValue;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { cn } from "..";
|
|
3
2
|
import clsx from "clsx";
|
|
4
3
|
import Popper from "../utils/Popper.svelte";
|
|
5
4
|
import { popover, type PopoverTheme } from "./theme";
|
|
@@ -13,15 +12,15 @@
|
|
|
13
12
|
let { base, title, h3, content } = $derived(popover({ color }));
|
|
14
13
|
</script>
|
|
15
14
|
|
|
16
|
-
<Popper {...restProps} bind:isOpen {placement} {trigger} {arrow} class={
|
|
15
|
+
<Popper {...restProps} bind:isOpen {placement} {trigger} {arrow} class={base({ class: clsx((theme as PopoverTheme)?.base, className) })}>
|
|
17
16
|
{#if typeof titleSlot === "string"}
|
|
18
|
-
<div class={
|
|
19
|
-
<h3 class={
|
|
17
|
+
<div class={title({ class: clsx((theme as PopoverTheme)?.title) })}>
|
|
18
|
+
<h3 class={h3({ class: clsx((theme as PopoverTheme)?.h3) })}>{titleSlot}</h3>
|
|
20
19
|
</div>
|
|
21
20
|
{:else if titleSlot}
|
|
22
21
|
{@render titleSlot()}
|
|
23
22
|
{/if}
|
|
24
|
-
<div class={
|
|
23
|
+
<div class={content({ class: clsx((theme as PopoverTheme)?.content, defaultClass) })}>
|
|
25
24
|
{@render children()}
|
|
26
25
|
</div>
|
|
27
26
|
</Popper>
|
package/dist/popover/theme.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type VariantProps } from "tailwind-variants";
|
|
2
|
+
import type { ClassValue } from "svelte/elements";
|
|
2
3
|
export type PopoverVariants = VariantProps<typeof popover>;
|
|
3
4
|
export declare const popover: import("tailwind-variants").TVReturnType<{
|
|
4
5
|
color: {
|
|
@@ -278,4 +279,4 @@ export declare const popover: import("tailwind-variants").TVReturnType<{
|
|
|
278
279
|
h3: string;
|
|
279
280
|
}, undefined, unknown, unknown, undefined>>;
|
|
280
281
|
export type PopoverSlots = keyof typeof popover.slots;
|
|
281
|
-
export type PopoverTheme = Partial<Record<PopoverSlots,
|
|
282
|
+
export type PopoverTheme = Partial<Record<PopoverSlots, ClassValue>>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { cn } from "..";
|
|
3
2
|
import type { ProgressbarProps } from "../types";
|
|
4
3
|
import clsx from "clsx";
|
|
5
4
|
import { cubicOut } from "svelte/easing";
|
|
@@ -28,18 +27,18 @@
|
|
|
28
27
|
</script>
|
|
29
28
|
|
|
30
29
|
{#if labelOutside}
|
|
31
|
-
<div {...restProps} class={
|
|
32
|
-
<span class={
|
|
33
|
-
<span class={
|
|
30
|
+
<div {...restProps} class={outsideDiv({ class: clsx((theme as ProgressbarTheme)?.outsideDiv, classes?.outsideDiv) })}>
|
|
31
|
+
<span class={oustsideSpan({ class: clsx((theme as ProgressbarTheme)?.oustsideSpan, classes?.oustsideSpan) })}>{labelOutside}</span>
|
|
32
|
+
<span class={outsideProgress({ class: clsx((theme as ProgressbarTheme)?.outsideProgress, classes?.outsideProgress) })}>{progress}%</span>
|
|
34
33
|
</div>
|
|
35
34
|
{/if}
|
|
36
|
-
<div {...restProps} class={
|
|
35
|
+
<div {...restProps} class={base({ class: clsx(size, classes?.base, (theme as ProgressbarTheme)?.base, className) })}>
|
|
37
36
|
{#if labelInside}
|
|
38
|
-
<div class={
|
|
37
|
+
<div class={labelInsideDiv({ class: clsx(size, (theme as ProgressbarTheme)?.labelInsideDiv, classes?.labelInsideDiv) })} style="width: {_progress.current}%">
|
|
39
38
|
{_progress.current.toFixed(precision)}%
|
|
40
39
|
</div>
|
|
41
40
|
{:else}
|
|
42
|
-
<div class={
|
|
41
|
+
<div class={insideDiv({ class: clsx(size, (theme as ProgressbarTheme)?.insideDiv, classes?.labelInsideDiv) })} style="width: {_progress.current}%"></div>
|
|
43
42
|
{/if}
|
|
44
43
|
</div>
|
|
45
44
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { cn } from "..";
|
|
3
2
|
import { progressradial, type ProgressradialTheme } from ".";
|
|
4
3
|
import type { ProgressradialProps } from "../types";
|
|
5
4
|
import clsx from "clsx";
|
|
@@ -39,23 +38,23 @@
|
|
|
39
38
|
|
|
40
39
|
<div class="flex flex-col items-center">
|
|
41
40
|
{#if labelOutside}
|
|
42
|
-
<div class={
|
|
43
|
-
<span class={
|
|
44
|
-
<span class={
|
|
41
|
+
<div class={outsideDiv({ class: clsx((theme as ProgressradialTheme)?.outsideDiv, classes?.outsideDiv) })}>
|
|
42
|
+
<span class={outsideSpan({ class: clsx((theme as ProgressradialTheme)?.outsideSpan, classes?.outsideSpan) })}>{labelOutside}</span>
|
|
43
|
+
<span class={outsideProgress({ class: clsx((theme as ProgressradialTheme)?.outsideProgress, classes?.outsideProgress) })}>{formattedProgress}%</span>
|
|
45
44
|
</div>
|
|
46
45
|
{/if}
|
|
47
46
|
|
|
48
|
-
<div {...restProps} class={
|
|
47
|
+
<div {...restProps} class={base({ class: clsx(size, (theme as ProgressradialTheme)?.base, classes?.base, className) })}>
|
|
49
48
|
<svg viewBox="0 0 100 100" class="h-full w-full" style="transform: rotate({rotationAngle}deg)">
|
|
50
49
|
<!-- Background circle -->
|
|
51
|
-
<circle cx="50" cy="50" r={radius} class={
|
|
50
|
+
<circle cx="50" cy="50" r={radius} class={circleBackground({ class: clsx((theme as ProgressradialTheme)?.circleBackground, classes?.circleBackground) })} fill="none" stroke-width={thickness} />
|
|
52
51
|
|
|
53
52
|
<!-- Foreground circle (progress indicator) -->
|
|
54
|
-
<circle cx="50" cy="50" r={radius} class={
|
|
53
|
+
<circle cx="50" cy="50" r={radius} class={circleForeground({ class: clsx((theme as ProgressradialTheme)?.circleForeground, classes?.circleForeground) })} fill="none" stroke-width={thickness} stroke-dasharray={circumference} stroke-dashoffset={strokeDashoffset} stroke-linecap="round" />
|
|
55
54
|
</svg>
|
|
56
55
|
|
|
57
56
|
{#if labelInside}
|
|
58
|
-
<div class={
|
|
57
|
+
<div class={labelInsideDiv({ class: clsx((theme as ProgressradialTheme)?.labelInsideDiv, classes?.labelInsideDiv) })}>
|
|
59
58
|
{formattedProgress}%
|
|
60
59
|
</div>
|
|
61
60
|
{/if}
|
package/dist/progress/theme.d.ts
CHANGED
|
@@ -290,7 +290,7 @@ export declare const progressbar: import("tailwind-variants").TVReturnType<{
|
|
|
290
290
|
outsideProgress: string;
|
|
291
291
|
}, undefined, unknown, unknown, undefined>>;
|
|
292
292
|
export type ProgressbarSlots = keyof typeof progressbar.slots;
|
|
293
|
-
export type ProgressbarTheme = Partial<Record<ProgressbarSlots,
|
|
293
|
+
export type ProgressbarTheme = Partial<Record<ProgressbarSlots, ClassValue>>;
|
|
294
294
|
export type ProgressradialClasses = Partial<{
|
|
295
295
|
[K in keyof (typeof progressradial)["slots"]]: ClassValue;
|
|
296
296
|
}>;
|
|
@@ -581,4 +581,4 @@ export declare const progressradial: import("tailwind-variants").TVReturnType<{
|
|
|
581
581
|
outsideProgress: string;
|
|
582
582
|
}, undefined, unknown, unknown, undefined>>;
|
|
583
583
|
export type ProgressradialSlots = keyof typeof progressradial.slots;
|
|
584
|
-
export type ProgressradialTheme = Partial<Record<ProgressradialSlots,
|
|
584
|
+
export type ProgressradialTheme = Partial<Record<ProgressradialSlots, ClassValue>>;
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
import { advancedRating, type AdvancedRatingTheme } from ".";
|
|
4
4
|
import type { AdvancedRatingProps } from "../types";
|
|
5
|
-
import { cn } from "..";
|
|
6
5
|
import { getTheme } from "../theme/themeUtils";
|
|
7
6
|
|
|
8
7
|
let { rating, globalText, ratings, divClass, spanClass, div2Class, div3Class, span2Class, unit }: AdvancedRatingProps = $props();
|
|
@@ -19,12 +18,12 @@
|
|
|
19
18
|
{@render globalText()}
|
|
20
19
|
{/if}
|
|
21
20
|
{#each ratings as { label, rating }}
|
|
22
|
-
<div class={
|
|
23
|
-
<span class={
|
|
24
|
-
<div class={
|
|
25
|
-
<div class={
|
|
21
|
+
<div class={base({ class: clsx((theme as AdvancedRatingTheme)?.base, divClass) })}>
|
|
22
|
+
<span class={span({ class: clsx((theme as AdvancedRatingTheme)?.span, spanClass) })}>{label}</span>
|
|
23
|
+
<div class={div2({ class: clsx((theme as AdvancedRatingTheme)?.div2, div2Class) })}>
|
|
24
|
+
<div class={div3({ class: clsx((theme as AdvancedRatingTheme)?.div3, div3Class) })} style="width: {rating}%"></div>
|
|
26
25
|
</div>
|
|
27
|
-
<span class={
|
|
26
|
+
<span class={span2({ class: clsx((theme as AdvancedRatingTheme)?.span2, span2Class) })}>{rating}{unit}</span>
|
|
28
27
|
</div>
|
|
29
28
|
{/each}
|
|
30
29
|
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import Star from "./Star.svelte";
|
|
4
4
|
import { rating as ratingVariants, type RatingTheme } from ".";
|
|
5
5
|
import type { RatingProps } from "../types";
|
|
6
|
-
import { cn } from "..";
|
|
7
6
|
import { getTheme } from "../theme/themeUtils";
|
|
8
7
|
|
|
9
8
|
let { children, text, class: className, size = 24, total = 5, rating = 4, icon: Icon = Star, count = false, pClass, ...restProps }: RatingProps = $props();
|
|
@@ -18,10 +17,10 @@
|
|
|
18
17
|
let grayStars: number = total - (fullStars + Math.ceil(rateDiffence));
|
|
19
18
|
</script>
|
|
20
19
|
|
|
21
|
-
<div {...restProps} class={
|
|
20
|
+
<div {...restProps} class={base({ class: clsx((theme as RatingTheme)?.base, className) })}>
|
|
22
21
|
{#if count && children}
|
|
23
22
|
<Icon fillPercent={100} {size} iconIndex={0} groupId={ratingGroupId} />
|
|
24
|
-
<p class={
|
|
23
|
+
<p class={p({ class: clsx((theme as RatingTheme)?.p, pClass) })}>{rating}</p>
|
|
25
24
|
{@render children()}
|
|
26
25
|
{:else}
|
|
27
26
|
<!-- eslint-disable @typescript-eslint/no-unused-vars-->
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
import { review as reviewVariants, type ReviewTheme } from ".";
|
|
4
4
|
import type { ReviewProps } from "../types";
|
|
5
|
-
import { cn } from "..";
|
|
6
5
|
import { getTheme } from "../theme/themeUtils";
|
|
7
6
|
|
|
8
7
|
let { children, address, item1, item2, item3, review, articleClass, divClass, div2Class, div3Class, imgClass, ulClass, liClass }: ReviewProps = $props();
|
|
@@ -13,15 +12,15 @@
|
|
|
13
12
|
</script>
|
|
14
13
|
|
|
15
14
|
{#if review}
|
|
16
|
-
<article class={
|
|
15
|
+
<article class={article({ class: clsx((theme as ReviewTheme)?.article, articleClass) })}>
|
|
17
16
|
<div>
|
|
18
|
-
<div class={
|
|
19
|
-
<img class={
|
|
20
|
-
<div class={
|
|
17
|
+
<div class={div({ class: clsx((theme as ReviewTheme)?.div, divClass) })}>
|
|
18
|
+
<img class={img({ class: clsx((theme as ReviewTheme)?.img, imgClass) })} src={review.imgSrc} alt={review.imgAlt} />
|
|
19
|
+
<div class={div2({ class: clsx((theme as ReviewTheme)?.div2, div2Class) })}>
|
|
21
20
|
<p>{review.name}</p>
|
|
22
21
|
{#if review.address}
|
|
23
22
|
{#if address}
|
|
24
|
-
<div class={
|
|
23
|
+
<div class={div3({ class: clsx((theme as ReviewTheme)?.div3, div3Class) })}>
|
|
25
24
|
{@render address()}
|
|
26
25
|
</div>
|
|
27
26
|
{/if}
|
|
@@ -29,9 +28,9 @@
|
|
|
29
28
|
</div>
|
|
30
29
|
</div>
|
|
31
30
|
{#if review.item1 || review.item2 || review.item3}
|
|
32
|
-
<ul class={
|
|
31
|
+
<ul class={ul({ class: clsx((theme as ReviewTheme)?.ul, ulClass) })}>
|
|
33
32
|
{#if review.item1}
|
|
34
|
-
<li class={
|
|
33
|
+
<li class={li({ class: clsx((theme as ReviewTheme)?.li, liClass) })}>
|
|
35
34
|
{#if item1}
|
|
36
35
|
{@render item1()}
|
|
37
36
|
{/if}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { scoreRating, type ScoreRatingTheme } from ".";
|
|
3
3
|
import type { ScoreRatingProps } from "../types";
|
|
4
|
-
import
|
|
4
|
+
import clsx from "clsx";
|
|
5
5
|
import { getTheme } from "../theme/themeUtils";
|
|
6
6
|
|
|
7
7
|
let { ratings, ratings2, headerLabel }: ScoreRatingProps = $props();
|
|
@@ -14,17 +14,17 @@
|
|
|
14
14
|
<div class="mb-5 flex items-center">
|
|
15
15
|
{#if headerLabel}
|
|
16
16
|
{#if headerLabel.desc1}
|
|
17
|
-
<p class={
|
|
17
|
+
<p class={desc1({ class: clsx((theme as ScoreRatingTheme)?.desc1) })}>{headerLabel.desc1}</p>
|
|
18
18
|
{/if}
|
|
19
19
|
{#if headerLabel.desc2}
|
|
20
|
-
<p class={
|
|
20
|
+
<p class={desc2({ class: clsx((theme as ScoreRatingTheme)?.desc2) })}>{headerLabel.desc2}</p>
|
|
21
21
|
{/if}
|
|
22
22
|
{#if headerLabel.desc3}
|
|
23
|
-
<span class={
|
|
24
|
-
<p class={
|
|
23
|
+
<span class={desc3span({ class: clsx((theme as ScoreRatingTheme)?.desc3span) })}></span>
|
|
24
|
+
<p class={desc3p({ class: clsx((theme as ScoreRatingTheme)?.desc3p) })}>{headerLabel.desc3}</p>
|
|
25
25
|
{/if}
|
|
26
26
|
{#if headerLabel.link}
|
|
27
|
-
<a href={headerLabel.link.url} class={
|
|
27
|
+
<a href={headerLabel.link.url} class={link({ class: clsx((theme as ScoreRatingTheme)?.link) })}>{headerLabel.link.label}</a>
|
|
28
28
|
{/if}
|
|
29
29
|
{/if}
|
|
30
30
|
</div>
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
</dt>
|
|
39
39
|
<dd class="mb-3 flex items-center">
|
|
40
40
|
<div class="me-2 h-2.5 w-full rounded-sm bg-gray-200 dark:bg-gray-700">
|
|
41
|
-
<div class={
|
|
41
|
+
<div class={bar({ class: clsx((theme as ScoreRatingTheme)?.bar) })} style="width: {rating * 10}%"></div>
|
|
42
42
|
</div>
|
|
43
43
|
<span class="text-sm font-medium text-gray-500 dark:text-gray-400">{rating}</span>
|
|
44
44
|
</dd>
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
</dt>
|
|
56
56
|
<dd class="mb-3 flex items-center">
|
|
57
57
|
<div class="me-2 h-2.5 w-full rounded-sm bg-gray-200 dark:bg-gray-700">
|
|
58
|
-
<div class={
|
|
58
|
+
<div class={bar({ class: clsx((theme as ScoreRatingTheme)?.bar) })} style="width: {rating * 10}%"></div>
|
|
59
59
|
</div>
|
|
60
60
|
<span class="text-sm font-medium text-gray-500 dark:text-gray-400">{rating}</span>
|
|
61
61
|
</dd>
|
package/dist/rating/theme.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ClassValue } from "svelte/elements";
|
|
1
2
|
export declare const advancedRating: import("tailwind-variants").TVReturnType<{
|
|
2
3
|
[key: string]: {
|
|
3
4
|
[key: string]: import("tailwind-variants").ClassValue | {
|
|
@@ -48,7 +49,7 @@ export declare const advancedRating: import("tailwind-variants").TVReturnType<{
|
|
|
48
49
|
span2: string;
|
|
49
50
|
}, undefined, unknown, unknown, undefined>>;
|
|
50
51
|
export type AdvancedRatingSlots = keyof typeof advancedRating.slots;
|
|
51
|
-
export type AdvancedRatingTheme = Partial<Record<AdvancedRatingSlots,
|
|
52
|
+
export type AdvancedRatingTheme = Partial<Record<AdvancedRatingSlots, ClassValue>>;
|
|
52
53
|
export declare const rating: import("tailwind-variants").TVReturnType<{
|
|
53
54
|
[key: string]: {
|
|
54
55
|
[key: string]: import("tailwind-variants").ClassValue | {
|
|
@@ -81,7 +82,7 @@ export declare const rating: import("tailwind-variants").TVReturnType<{
|
|
|
81
82
|
p: string;
|
|
82
83
|
}, undefined, unknown, unknown, undefined>>;
|
|
83
84
|
export type RatingSlots = keyof typeof rating.slots;
|
|
84
|
-
export type RatingTheme = Partial<Record<RatingSlots,
|
|
85
|
+
export type RatingTheme = Partial<Record<RatingSlots, ClassValue>>;
|
|
85
86
|
export declare const review: import("tailwind-variants").TVReturnType<{
|
|
86
87
|
[key: string]: {
|
|
87
88
|
[key: string]: import("tailwind-variants").ClassValue | {
|
|
@@ -144,7 +145,7 @@ export declare const review: import("tailwind-variants").TVReturnType<{
|
|
|
144
145
|
li: string;
|
|
145
146
|
}, undefined, unknown, unknown, undefined>>;
|
|
146
147
|
export type ReviewSlots = keyof typeof review.slots;
|
|
147
|
-
export type ReviewTheme = Partial<Record<ReviewSlots,
|
|
148
|
+
export type ReviewTheme = Partial<Record<ReviewSlots, ClassValue>>;
|
|
148
149
|
export declare const scoreRating: import("tailwind-variants").TVReturnType<{
|
|
149
150
|
[key: string]: {
|
|
150
151
|
[key: string]: import("tailwind-variants").ClassValue | {
|
|
@@ -201,4 +202,4 @@ export declare const scoreRating: import("tailwind-variants").TVReturnType<{
|
|
|
201
202
|
bar: string;
|
|
202
203
|
}, undefined, unknown, unknown, undefined>>;
|
|
203
204
|
export type ScoreRatingSlots = keyof typeof scoreRating.slots;
|
|
204
|
-
export type ScoreRatingTheme = Partial<Record<ScoreRatingSlots,
|
|
205
|
+
export type ScoreRatingTheme = Partial<Record<ScoreRatingSlots, ClassValue>>;
|
|
@@ -5,32 +5,10 @@
|
|
|
5
5
|
import { sineIn } from "svelte/easing";
|
|
6
6
|
import { sidebar, type SidebarTheme } from ".";
|
|
7
7
|
import { trapFocus, type SidebarProps, type SidebarCtxType } from "..";
|
|
8
|
-
import { cn } from "..";
|
|
9
8
|
import { getTheme } from "../theme/themeUtils";
|
|
10
9
|
import clsx from "clsx";
|
|
11
10
|
|
|
12
|
-
let {
|
|
13
|
-
children,
|
|
14
|
-
isOpen = false, // Controls the *overlay* state on small screens
|
|
15
|
-
closeSidebar,
|
|
16
|
-
isSingle = true,
|
|
17
|
-
breakpoint = "md", // e.g., 'md'
|
|
18
|
-
alwaysOpen = false, // When true, sidebar is always visible, no hamburger menu
|
|
19
|
-
position = "fixed",
|
|
20
|
-
activateClickOutside = true,
|
|
21
|
-
backdrop = true,
|
|
22
|
-
backdropClass,
|
|
23
|
-
transition = fly,
|
|
24
|
-
params,
|
|
25
|
-
divClass,
|
|
26
|
-
ariaLabel,
|
|
27
|
-
nonActiveClass,
|
|
28
|
-
activeClass,
|
|
29
|
-
activeUrl = "",
|
|
30
|
-
class: className,
|
|
31
|
-
disableBreakpoints = false, // Key prop for Drawer integration
|
|
32
|
-
...restProps
|
|
33
|
-
}: SidebarProps = $props();
|
|
11
|
+
let { children, isOpen = false, closeSidebar, isSingle = true, breakpoint = "md", alwaysOpen = false, position = "fixed", activateClickOutside = true, backdrop = true, backdropClass, transition = fly, params, divClass, ariaLabel, nonActiveClass, activeClass, activeUrl = "", class: className, disableBreakpoints = false, ...restProps }: SidebarProps = $props();
|
|
34
12
|
|
|
35
13
|
const theme = getTheme("sidebar");
|
|
36
14
|
|
|
@@ -43,15 +21,8 @@
|
|
|
43
21
|
};
|
|
44
22
|
|
|
45
23
|
let innerWidth: number = $state(-1);
|
|
46
|
-
//
|
|
47
|
-
|
|
48
|
-
// It determines if the screen size *would* make it "large" if alwaysOpen were applied.
|
|
49
|
-
let isLargeScreen = $derived(innerWidth >= breakpointValues[breakpoint]);
|
|
50
|
-
|
|
51
|
-
// Determine if the sidebar should be "open" based on explicit isOpen or large screen AND alwaysOpen
|
|
52
|
-
// This state is what should drive the 'hidden' / 'block' classes for the sidebar itself,
|
|
53
|
-
// which will be passed to tailwind-variants.
|
|
54
|
-
let shouldBeOpen = $derived(isOpen || (alwaysOpen && isLargeScreen));
|
|
24
|
+
// isLargeScreen should only be true if not disabling breakpoints and it meets the criteria
|
|
25
|
+
let isLargeScreen = $derived(disableBreakpoints ? false : alwaysOpen || innerWidth >= breakpointValues[breakpoint]);
|
|
55
26
|
|
|
56
27
|
const activeUrlStore = writable("");
|
|
57
28
|
setContext("activeUrl", activeUrlStore);
|
|
@@ -59,42 +30,27 @@
|
|
|
59
30
|
activeUrlStore.set(activeUrl);
|
|
60
31
|
});
|
|
61
32
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
const {
|
|
65
|
-
base,
|
|
66
|
-
active,
|
|
67
|
-
nonactive,
|
|
68
|
-
div,
|
|
69
|
-
backdrop: backdropCls
|
|
70
|
-
} = $derived(
|
|
71
|
-
sidebar({
|
|
72
|
-
isOpen: shouldBeOpen, // Now dynamically drives the tv `isOpen` variant
|
|
73
|
-
breakpoint: alwaysOpen ? undefined : breakpoint, // Apply breakpoint variant ONLY if not alwaysOpen
|
|
74
|
-
position,
|
|
75
|
-
backdrop: backdrop && !disableBreakpoints, // Backdrop for standalone sidebar
|
|
76
|
-
alwaysOpen // Pass alwaysOpen directly
|
|
77
|
-
})
|
|
78
|
-
);
|
|
33
|
+
if (disableBreakpoints) isOpen = true;
|
|
34
|
+
const { base, active, nonactive, div, backdrop: backdropCls } = $derived(sidebar({ isOpen, breakpoint, position, backdrop, alwaysOpen: alwaysOpen && !disableBreakpoints }));
|
|
79
35
|
|
|
80
36
|
let sidebarCtx: SidebarCtxType = {
|
|
81
37
|
get closeSidebar() {
|
|
82
38
|
return closeSidebar;
|
|
83
39
|
},
|
|
84
40
|
get activeClass() {
|
|
85
|
-
return
|
|
41
|
+
return active({ class: clsx((theme as SidebarTheme)?.active, activeClass) });
|
|
86
42
|
},
|
|
87
43
|
get nonActiveClass() {
|
|
88
|
-
return
|
|
44
|
+
return nonactive({ class: clsx((theme as SidebarTheme)?.nonactive, nonActiveClass) });
|
|
89
45
|
},
|
|
90
46
|
isSingle
|
|
91
47
|
};
|
|
92
48
|
|
|
93
|
-
// Transition parameters for the fly effect when opening/closing
|
|
94
49
|
let transitionParams = params ? params : { x: -320, duration: 200, easing: sineIn };
|
|
95
50
|
|
|
96
51
|
setContext("sidebarContext", sidebarCtx);
|
|
97
52
|
|
|
53
|
+
// Handler for Escape key
|
|
98
54
|
const handleEscape = () => {
|
|
99
55
|
closeSidebar?.();
|
|
100
56
|
};
|
|
@@ -103,18 +59,27 @@
|
|
|
103
59
|
<svelte:window bind:innerWidth />
|
|
104
60
|
|
|
105
61
|
{#if !disableBreakpoints}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
{
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
62
|
+
{#if isOpen || isLargeScreen}
|
|
63
|
+
{#if isOpen && !alwaysOpen}
|
|
64
|
+
{#if backdrop && activateClickOutside}
|
|
65
|
+
<div role="presentation" class={backdropCls({ class: clsx((theme as SidebarTheme)?.backdrop, backdropClass) })} onclick={closeSidebar}></div>
|
|
66
|
+
{:else if backdrop && !activateClickOutside}
|
|
67
|
+
<div role="presentation" class={backdropCls({ class: clsx((theme as SidebarTheme)?.backdrop, backdropClass) })}></div>
|
|
68
|
+
{:else if !backdrop && activateClickOutside}
|
|
69
|
+
<div role="presentation" class="fixed start-0 top-0 z-50 h-full w-full" onclick={closeSidebar}></div>
|
|
70
|
+
{:else if !backdrop && !activateClickOutside}
|
|
71
|
+
<div role="presentation" class="fixed start-0 top-0 z-50 h-full w-full"></div>
|
|
72
|
+
{/if}
|
|
73
|
+
{/if}
|
|
74
|
+
<aside use:trapFocus={!isLargeScreen && isOpen && !alwaysOpen ? { onEscape: closeSidebar ? handleEscape : undefined } : null} transition:transition={!alwaysOpen ? transitionParams : undefined} {...restProps} class={base({ class: clsx((theme as SidebarTheme)?.base, className) })} aria-label={ariaLabel}>
|
|
75
|
+
<div class={div({ class: clsx((theme as SidebarTheme)?.base, divClass) })}>
|
|
76
|
+
{@render children()}
|
|
77
|
+
</div>
|
|
78
|
+
</aside>
|
|
114
79
|
{/if}
|
|
115
80
|
{:else}
|
|
116
|
-
<aside use:trapFocus={isOpen ? { onEscape: closeSidebar ? handleEscape : undefined } : null}
|
|
117
|
-
<div class={
|
|
81
|
+
<aside use:trapFocus={isOpen ? { onEscape: closeSidebar ? handleEscape : undefined } : null} {...restProps} class={base({ class: clsx((theme as SidebarTheme)?.base, className) })} aria-label={ariaLabel}>
|
|
82
|
+
<div class={div({ class: clsx((theme as SidebarTheme)?.base, divClass) })}>
|
|
118
83
|
{@render children()}
|
|
119
84
|
</div>
|
|
120
85
|
</aside>
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
import { sidebarBrand, type SidebarBrandTheme } from ".";
|
|
4
4
|
import type { SidebarBrandProps } from "../types";
|
|
5
|
-
import { cn } from "..";
|
|
6
5
|
import { getTheme } from "../theme/themeUtils";
|
|
7
6
|
|
|
8
7
|
let { children, site, imgClass, spanClass, class: className, ...restProps }: SidebarBrandProps = $props();
|
|
@@ -12,10 +11,10 @@
|
|
|
12
11
|
const { base, img, span } = $derived(sidebarBrand());
|
|
13
12
|
</script>
|
|
14
13
|
|
|
15
|
-
<a {...restProps} href={site?.href ? site.href : "/"} class={
|
|
14
|
+
<a {...restProps} href={site?.href ? site.href : "/"} class={base({ class: clsx((theme as SidebarBrandTheme)?.base, className) })}>
|
|
16
15
|
{#if site}
|
|
17
|
-
<img src={site.img} class={
|
|
18
|
-
<span class={
|
|
16
|
+
<img src={site.img} class={img({ class: clsx((theme as SidebarBrandTheme)?.img, imgClass) })} alt={site.name} />
|
|
17
|
+
<span class={span({ class: clsx((theme as SidebarBrandTheme)?.span, spanClass) })}>{site.name}</span>
|
|
19
18
|
{:else if children}
|
|
20
19
|
{@render children()}
|
|
21
20
|
{/if}
|
|
@@ -2,14 +2,13 @@
|
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
import { sidebarButton } from ".";
|
|
4
4
|
import type { SidebarButtonProps } from "../types";
|
|
5
|
-
import { cn } from "..";
|
|
6
5
|
import { getTheme } from "../theme/themeUtils";
|
|
7
6
|
|
|
8
7
|
let { breakpoint = "md", class: className, ...restProps }: SidebarButtonProps = $props();
|
|
9
8
|
|
|
10
9
|
const theme = getTheme("sidebarButton");
|
|
11
10
|
|
|
12
|
-
const base = $derived(
|
|
11
|
+
const base = $derived(sidebarButton({ breakpoint, class: clsx(theme, className) }));
|
|
13
12
|
</script>
|
|
14
13
|
|
|
15
14
|
<button {...restProps} type="button" class={base}>
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
import { sidebarCta, type SidebarCtaTheme } from ".";
|
|
4
4
|
import type { SidebarCtaProps } from "../types";
|
|
5
|
-
import { cn } from "..";
|
|
6
5
|
import { getTheme } from "../theme/themeUtils";
|
|
7
6
|
|
|
8
7
|
let { children, icon, divClass, spanClass, label, class: className, ...restProps }: SidebarCtaProps = $props();
|
|
@@ -12,9 +11,9 @@
|
|
|
12
11
|
const { base, div, span } = $derived(sidebarCta());
|
|
13
12
|
</script>
|
|
14
13
|
|
|
15
|
-
<div {...restProps} id="dropdown-cta" class={
|
|
16
|
-
<div class={
|
|
17
|
-
<span class={
|
|
14
|
+
<div {...restProps} id="dropdown-cta" class={base({ class: clsx((theme as SidebarCtaTheme)?.base, className) })} role="alert">
|
|
15
|
+
<div class={div({ class: clsx((theme as SidebarCtaTheme)?.div, divClass) })}>
|
|
16
|
+
<span class={span({ class: clsx((theme as SidebarCtaTheme)?.span, spanClass) })}>{label}</span>
|
|
18
17
|
{#if icon}
|
|
19
18
|
{@render icon()}
|
|
20
19
|
{/if}
|