flowbite-svelte 1.19.0 → 1.20.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.
Files changed (89) hide show
  1. package/dist/accordion/AccordionItem.svelte +15 -1
  2. package/dist/alert/Alert.svelte +15 -2
  3. package/dist/badge/Badge.svelte +19 -2
  4. package/dist/banner/Banner.svelte +16 -1
  5. package/dist/bottom-navigation/BottomNavItem.svelte +7 -1
  6. package/dist/breadcrumb/BreadcrumbItem.svelte +3 -1
  7. package/dist/carousel/Carousel.svelte +35 -4
  8. package/dist/datepicker/Datepicker.svelte +69 -6
  9. package/dist/device-mockups/Android.svelte +5 -1
  10. package/dist/device-mockups/DefaultMockup.svelte +5 -1
  11. package/dist/device-mockups/Ios.svelte +5 -1
  12. package/dist/device-mockups/Laptop.svelte +5 -1
  13. package/dist/device-mockups/Smartwatch.svelte +5 -1
  14. package/dist/device-mockups/Tablet.svelte +5 -1
  15. package/dist/dialog/Dialog.svelte +38 -7
  16. package/dist/drawer/Drawer.svelte +29 -2
  17. package/dist/forms/button-toggle/ButtonToggle.svelte +9 -1
  18. package/dist/forms/button-toggle/ButtonToggleGroup.svelte +14 -1
  19. package/dist/forms/button-toggle/CheckIcon.svelte +13 -1
  20. package/dist/forms/checkbox/Checkbox.svelte +18 -1
  21. package/dist/forms/fileupload/Fileupload.svelte +14 -1
  22. package/dist/forms/floating-label/FloatingLabelInput.svelte +48 -5
  23. package/dist/forms/input-addon/InputAddon.svelte +12 -1
  24. package/dist/forms/input-field/Input.svelte +60 -9
  25. package/dist/forms/phoneinput/PhoneInput.svelte +14 -2
  26. package/dist/forms/phoneinput/PhoneInput.svelte.d.ts +1 -1
  27. package/dist/forms/radio/Radio.svelte +14 -1
  28. package/dist/forms/search/Search.svelte +16 -1
  29. package/dist/forms/select/MultiSelect.svelte +10 -1
  30. package/dist/forms/select/Select.svelte +20 -1
  31. package/dist/forms/tags/Tags.svelte +35 -11
  32. package/dist/forms/textarea/Textarea.svelte +27 -2
  33. package/dist/forms/textarea/theme.js +3 -1
  34. package/dist/forms/timepicker/Timepicker.svelte +143 -13
  35. package/dist/index.d.ts +1 -0
  36. package/dist/index.js +1 -0
  37. package/dist/kanban/KanbanBoard.svelte +98 -0
  38. package/dist/kanban/KanbanBoard.svelte.d.ts +4 -0
  39. package/dist/kanban/KanbanCard.svelte +58 -0
  40. package/dist/kanban/KanbanCard.svelte.d.ts +16 -0
  41. package/dist/kanban/index.d.ts +3 -0
  42. package/dist/kanban/index.js +3 -0
  43. package/dist/kanban/theme.d.ts +108 -0
  44. package/dist/kanban/theme.js +43 -0
  45. package/dist/mega-menu/MegaMenu.svelte +1 -8
  46. package/dist/modal/Modal.svelte +30 -2
  47. package/dist/navbar/NavHamburger.svelte +1 -1
  48. package/dist/navbar/NavLi.svelte +3 -1
  49. package/dist/navbar/NavUl.svelte +14 -1
  50. package/dist/pagination/theme.js +4 -1
  51. package/dist/popover/Popover.svelte +13 -1
  52. package/dist/progress/Progressbar.svelte +14 -1
  53. package/dist/progress/Progressradial.svelte +28 -2
  54. package/dist/rating/AdvancedRating.svelte +5 -1
  55. package/dist/rating/CustomIcon.svelte +13 -1
  56. package/dist/rating/Heart.svelte +19 -2
  57. package/dist/rating/Review.svelte +6 -3
  58. package/dist/rating/Review.svelte.d.ts +0 -1
  59. package/dist/rating/Star.svelte +12 -1
  60. package/dist/rating/Thumbup.svelte +19 -2
  61. package/dist/sidebar/Sidebar.svelte +30 -2
  62. package/dist/sidebar/SidebarButton.svelte +5 -1
  63. package/dist/sidebar/SidebarDropdownWrapper.svelte +18 -1
  64. package/dist/skeleton/CardPlaceholder.svelte +8 -2
  65. package/dist/skeleton/ImagePlaceholder.svelte +3 -1
  66. package/dist/skeleton/TestimonialPlaceholder.svelte +5 -1
  67. package/dist/skeleton/VideoPlaceholder.svelte +3 -1
  68. package/dist/speed-dial/SpeedDial.svelte +13 -1
  69. package/dist/speed-dial/SpeedDialButton.svelte +12 -1
  70. package/dist/spinner/Spinner.svelte +8 -2
  71. package/dist/step-indicator/StepIndicator.svelte +14 -2
  72. package/dist/stepper/DetailedStepper.svelte +1 -1
  73. package/dist/stepper/ProgressStepper.svelte +3 -1
  74. package/dist/stepper/TimelineStepper.svelte +3 -1
  75. package/dist/stepper/VerticalStepper.svelte +1 -1
  76. package/dist/table/TableSearch.svelte +26 -2
  77. package/dist/theme/themeUtils.js +3 -1
  78. package/dist/theme/themes.d.ts +1 -0
  79. package/dist/theme/themes.js +1 -0
  80. package/dist/timeline/GroupItem.svelte +10 -2
  81. package/dist/timeline/TimelineItem.svelte +24 -2
  82. package/dist/toast/Toast.svelte +17 -2
  83. package/dist/tooltip/Tooltip.svelte +12 -4
  84. package/dist/types.d.ts +27 -1
  85. package/dist/typography/paragraph/P.svelte +14 -1
  86. package/dist/utils/CloseButton.svelte +10 -2
  87. package/dist/utils/Popper.svelte +38 -2
  88. package/dist/virtuallist/VirtualList.svelte +8 -1
  89. package/package.json +12 -4
@@ -7,7 +7,21 @@
7
7
  import { slide } from "svelte/transition";
8
8
  import { accordionItem } from "./theme";
9
9
 
10
- let { children, header, arrowup, arrowdown, open = $bindable(false), activeClass, inactiveClass, transitionType = slide, transitionParams, class: className, classes, headerClass, contentClass }: AccordionItemProps = $props();
10
+ let {
11
+ children,
12
+ header,
13
+ arrowup,
14
+ arrowdown,
15
+ open = $bindable(false),
16
+ activeClass,
17
+ inactiveClass,
18
+ transitionType = slide,
19
+ transitionParams,
20
+ class: className,
21
+ classes,
22
+ headerClass,
23
+ contentClass
24
+ }: AccordionItemProps = $props();
11
25
 
12
26
  warnThemeDeprecation(
13
27
  "AccordionItem",
@@ -7,7 +7,20 @@
7
7
  import { getTheme } from "../theme/themeUtils";
8
8
  import { createDismissableContext } from "../utils/dismissable";
9
9
 
10
- let { children, icon, alertStatus = $bindable(true), closeIcon: CloseIcon, color = "primary", rounded = true, border, class: className, dismissable, transition = fade, params, ...restProps }: AlertProps = $props();
10
+ let {
11
+ children,
12
+ icon,
13
+ alertStatus = $bindable(true),
14
+ closeIcon: CloseIcon,
15
+ color = "primary",
16
+ rounded = true,
17
+ border,
18
+ class: className,
19
+ dismissable,
20
+ transition = fade,
21
+ params,
22
+ ...restProps
23
+ }: AlertProps = $props();
11
24
 
12
25
  // Theme context
13
26
  const theme = getTheme("alert");
@@ -25,7 +38,7 @@
25
38
 
26
39
  let ref: HTMLDivElement | undefined = $state(undefined);
27
40
 
28
- function close(event: MouseEvent) {
41
+ function close() {
29
42
  if (ref?.dispatchEvent(new Event("close", { bubbles: true, cancelable: true }))) {
30
43
  alertStatus = false;
31
44
  }
@@ -7,7 +7,24 @@
7
7
  import { badge } from "./theme";
8
8
  import { createDismissableContext } from "../utils/dismissable";
9
9
 
10
- let { children, icon, badgeStatus = $bindable(true), color = "primary", large = false, dismissable = false, class: className, classes, border, href, target, rounded, transition = fade, params, aClass, ...restProps }: BadgeProps = $props();
10
+ let {
11
+ children,
12
+ icon,
13
+ badgeStatus = $bindable(true),
14
+ color = "primary",
15
+ large = false,
16
+ dismissable = false,
17
+ class: className,
18
+ classes,
19
+ border,
20
+ href,
21
+ target,
22
+ rounded,
23
+ transition = fade,
24
+ params,
25
+ aClass,
26
+ ...restProps
27
+ }: BadgeProps = $props();
11
28
 
12
29
  warnThemeDeprecation("Badge", { aClass }, { aClass: "linkClass" });
13
30
 
@@ -20,7 +37,7 @@
20
37
 
21
38
  let ref: HTMLDivElement | undefined = $state(undefined);
22
39
 
23
- const close = (ev: Event) => {
40
+ const close = () => {
24
41
  if (ref?.dispatchEvent(new Event("close", { bubbles: true, cancelable: true }))) {
25
42
  badgeStatus = false;
26
43
  }
@@ -7,7 +7,22 @@
7
7
  import { getTheme, warnThemeDeprecation } from "../theme/themeUtils";
8
8
  import { createDismissableContext } from "../utils/dismissable";
9
9
 
10
- let { children, header, open = $bindable(true), dismissable = true, color = "gray", type, class: className, classes, innerClass, transition = fade, params, closeClass, onclose, ...restProps }: BannerProps = $props();
10
+ let {
11
+ children,
12
+ header,
13
+ open = $bindable(true),
14
+ dismissable = true,
15
+ color = "gray",
16
+ type,
17
+ class: className,
18
+ classes,
19
+ innerClass,
20
+ transition = fade,
21
+ params,
22
+ closeClass,
23
+ onclose,
24
+ ...restProps
25
+ }: BannerProps = $props();
11
26
 
12
27
  warnThemeDeprecation("Banner", { innerClass, closeClass }, { innerClass: "insideDiv", closeClass: "dismissable" });
13
28
 
@@ -23,7 +23,13 @@
23
23
  // Determine active state based on manual prop or URL matching
24
24
  let isActive = $derived.by(() => {
25
25
  const href = restProps.href ?? "";
26
- return manualActive !== undefined ? !!manualActive : navUrl ? (href === "/" ? navUrl === "/" : href && (navUrl === href || navUrl.startsWith(href + "/") || (href !== "/" && navUrl.replace(/^https?:\/\/[^/]+/, "").startsWith(href)))) : false;
26
+ return manualActive !== undefined
27
+ ? !!manualActive
28
+ : navUrl
29
+ ? href === "/"
30
+ ? navUrl === "/"
31
+ : href && (navUrl === href || navUrl.startsWith(href + "/") || (href !== "/" && navUrl.replace(/^https?:\/\/[^/]+/, "").startsWith(href)))
32
+ : false;
27
33
  });
28
34
 
29
35
  function getCommonClass() {
@@ -25,7 +25,9 @@
25
25
  {@render icon()}
26
26
  {:else}
27
27
  <svg class="me-2 h-4 w-4" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
28
- <path d="M10.707 2.293a1 1 0 00-1.414 0l-7 7a1 1 0 001.414 1.414L4 10.414V17a1 1 0 001 1h2a1 1 0 001-1v-2a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 001 1h2a1 1 0 001-1v-6.586l.293.293a1 1 0 001.414-1.414l-7-7z" />
28
+ <path
29
+ d="M10.707 2.293a1 1 0 00-1.414 0l-7 7a1 1 0 001.414 1.414L4 10.414V17a1 1 0 001 1h2a1 1 0 001-1v-2a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 001 1h2a1 1 0 001-1v-6.586l.293.293a1 1 0 001.414-1.414l-7-7z"
30
+ />
29
31
  </svg>
30
32
  {/if}
31
33
 
@@ -9,7 +9,24 @@
9
9
 
10
10
  const SLIDE_DURATION_RATIO = 0.25;
11
11
 
12
- let { children, slide, images, index = $bindable(0), slideDuration = 1000, slideFit, transition, duration = 0, "aria-label": ariaLabel = "Draggable Carousel", disableSwipe = false, imgClass = "", class: className, classes, onchange, isPreload = false, ...restProps }: CarouselProps = $props();
12
+ let {
13
+ children,
14
+ slide,
15
+ images,
16
+ index = $bindable(0),
17
+ slideDuration = 1000,
18
+ slideFit,
19
+ transition,
20
+ duration = 0,
21
+ "aria-label": ariaLabel = "Draggable Carousel",
22
+ disableSwipe = false,
23
+ imgClass = "",
24
+ class: className,
25
+ classes,
26
+ onchange,
27
+ isPreload = false,
28
+ ...restProps
29
+ }: CarouselProps = $props();
13
30
 
14
31
  warnThemeDeprecation("Carousel", { imgClass }, { imgClass: "slide" });
15
32
 
@@ -57,7 +74,7 @@
57
74
  const nextSlide = () => changeSlide(_state.index + 1);
58
75
  const prevSlide = () => changeSlide(_state.index - 1);
59
76
 
60
- const loop = (node: HTMLElement) => {
77
+ const loop = () => {
61
78
  // loop timer
62
79
  /* eslint-disable @typescript-eslint/no-explicit-any */
63
80
  let intervalId: any;
@@ -127,7 +144,7 @@
127
144
  let onDragStop = $derived(
128
145
  activeDragGesture === undefined
129
146
  ? undefined
130
- : (evt: MouseEvent | TouchEvent) => {
147
+ : () => {
131
148
  // These might be exposed one day, keep them safely tucked away as constants.
132
149
  const SWIPE_MAX_DURATION = 250;
133
150
  const SWIPE_MIN_DISTANCE = 30;
@@ -173,7 +190,21 @@
173
190
 
174
191
  <!-- The move listeners go here, so things keep working if the touch strays out of the element. -->
175
192
  <svelte:document onmousemove={onDragMove} onmouseup={onDragStop} ontouchmove={onDragMove} ontouchend={onDragStop} />
176
- <div bind:this={carouselDiv} onmousedown={onDragStart} ontouchstart={onDragStart} onmousemove={onDragMove} onmouseup={onDragStop} ontouchmove={onDragMove} ontouchend={onDragStop} role="button" aria-label={ariaLabel} tabindex="0" {...restProps} class={base({ class: clsx(activeDragGesture === undefined ? "transition-transform" : "", theme?.base, className) })} {@attach loop}>
193
+ <div
194
+ bind:this={carouselDiv}
195
+ onmousedown={onDragStart}
196
+ ontouchstart={onDragStart}
197
+ onmousemove={onDragMove}
198
+ onmouseup={onDragStop}
199
+ ontouchmove={onDragMove}
200
+ ontouchend={onDragStop}
201
+ role="button"
202
+ aria-label={ariaLabel}
203
+ tabindex="0"
204
+ {...restProps}
205
+ class={base({ class: clsx(activeDragGesture === undefined ? "transition-transform" : "", theme?.base, className) })}
206
+ {@attach loop}
207
+ >
177
208
  {#if slide}
178
209
  {@render slide({ index: _state.index, Slide })}
179
210
  {:else}
@@ -9,7 +9,41 @@
9
9
  import { parse, isValid, addDays, startOfMonth, endOfMonth, startOfWeek, endOfWeek, eachDayOfInterval, isSameDay, isWithinInterval } from "date-fns";
10
10
  import { getTheme } from "../theme/themeUtils";
11
11
 
12
- let { value = $bindable(), defaultDate = null, range = false, rangeFrom = $bindable(), rangeTo = $bindable(), availableFrom = null, availableTo = null, locale = "default", translationLocale = locale, firstDayOfWeek = 0, dateFormat, placeholder = "Select date", disabled = false, required = false, inputClass = "", color = "primary", inline = false, autohide = true, showActionButtons = false, title = "", onselect, onclear, onapply, btnClass, inputmode = "none", classes, monthColor = "alternative", monthBtnSelected = "bg-primary-500 text-white", monthBtn = "text-gray-700 dark:text-gray-300", class: className, elementRef = $bindable(), actionSlot, inputProps = {} }: DatepickerProps = $props();
12
+ let {
13
+ value = $bindable(),
14
+ defaultDate = null,
15
+ range = false,
16
+ rangeFrom = $bindable(),
17
+ rangeTo = $bindable(),
18
+ availableFrom = null,
19
+ availableTo = null,
20
+ locale = "default",
21
+ translationLocale = locale,
22
+ firstDayOfWeek = 0,
23
+ dateFormat,
24
+ placeholder = "Select date",
25
+ disabled = false,
26
+ required = false,
27
+ inputClass = "",
28
+ color = "primary",
29
+ inline = false,
30
+ autohide = true,
31
+ showActionButtons = false,
32
+ title = "",
33
+ onselect,
34
+ onclear,
35
+ onapply,
36
+ btnClass,
37
+ inputmode = "none",
38
+ classes,
39
+ monthColor = "alternative",
40
+ monthBtnSelected = "bg-primary-500 text-white",
41
+ monthBtn = "text-gray-700 dark:text-gray-300",
42
+ class: className,
43
+ elementRef = $bindable(),
44
+ actionSlot,
45
+ inputProps = {}
46
+ }: DatepickerProps = $props();
13
47
 
14
48
  const theme = getTheme("datepicker");
15
49
 
@@ -326,7 +360,9 @@
326
360
 
327
361
  // Use translationLocale for aria-label
328
362
  setTimeout(() => {
329
- const focusedButton = calendarRef?.querySelector(`button[aria-label="${focusedDate!.toLocaleDateString(translationLocale, { weekday: "long", year: "numeric", month: "long", day: "numeric" })}"]`) as HTMLButtonElement | null;
363
+ const focusedButton = calendarRef?.querySelector(
364
+ `button[aria-label="${focusedDate!.toLocaleDateString(translationLocale, { weekday: "long", year: "numeric", month: "long", day: "numeric" })}"]`
365
+ ) as HTMLButtonElement | null;
330
366
  focusedButton?.focus();
331
367
  }, 0);
332
368
  }
@@ -377,10 +413,32 @@
377
413
  <div bind:this={datepickerContainerElement} class={["relative", inline && "inline-block"]}>
378
414
  {#if !inline}
379
415
  <div class="relative">
380
- <input {...inputProps} bind:this={inputElement} type="text" class={input({ color, class: clsx(theme?.input, inputClass) })} {placeholder} value={range ? `${formatDate(rangeFrom)} - ${formatDate(rangeTo)}` : formatDate(value)} onfocus={() => (isOpen = true)} onchange={handleInputChangeWithDateFns} onkeydown={handleInputKeydown} {disabled} {required} {inputmode} aria-haspopup="dialog" />
381
- <button type="button" class={button({ class: clsx(btnClass, theme?.button, classes?.button) })} onclick={() => (isOpen = !isOpen)} {disabled} aria-label={isOpen ? "Close date picker" : "Open date picker"}>
416
+ <input
417
+ {...inputProps}
418
+ bind:this={inputElement}
419
+ type="text"
420
+ class={input({ color, class: clsx(theme?.input, inputClass) })}
421
+ {placeholder}
422
+ value={range ? `${formatDate(rangeFrom)} - ${formatDate(rangeTo)}` : formatDate(value)}
423
+ onfocus={() => (isOpen = true)}
424
+ onchange={handleInputChangeWithDateFns}
425
+ onkeydown={handleInputKeydown}
426
+ {disabled}
427
+ {required}
428
+ {inputmode}
429
+ aria-haspopup="dialog"
430
+ />
431
+ <button
432
+ type="button"
433
+ class={button({ class: clsx(btnClass, theme?.button, classes?.button) })}
434
+ onclick={() => (isOpen = !isOpen)}
435
+ {disabled}
436
+ aria-label={isOpen ? "Close date picker" : "Open date picker"}
437
+ >
382
438
  <svg class="h-4 w-4 text-gray-500 dark:text-gray-400" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20">
383
- <path d="M20 4a2 2 0 0 0-2-2h-2V1a1 1 0 0 0-2 0v1h-3V1a1 1 0 0 0-2 0v1H6V1a1 1 0 0 0-2 0v1H2a2 2 0 0 0-2 2v2h20V4ZM0 18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8H0v10Zm5-8h10a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2Z"></path>
439
+ <path
440
+ d="M20 4a2 2 0 0 0-2-2h-2V1a1 1 0 0 0-2 0v1h-3V1a1 1 0 0 0-2 0v1H6V1a1 1 0 0 0-2 0v1H2a2 2 0 0 0-2 2v2h20V4ZM0 18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8H0v10Zm5-8h10a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2Z"
441
+ ></path>
384
442
  </svg>
385
443
  </button>
386
444
  </div>
@@ -418,7 +476,12 @@
418
476
  {:else}
419
477
  <div class={nav({ class: clsx(classes?.nav) })}>
420
478
  {@render navButton(false)}
421
- <Button type="button" class={polite({ class: clsx("cursor-pointer rounded px-2 py-1 hover:bg-gray-100 dark:hover:bg-gray-700", classes?.polite) })} aria-live="polite" onclick={(event: MouseEvent) => toggleMonthSelector(event)}>
479
+ <Button
480
+ type="button"
481
+ class={polite({ class: clsx("cursor-pointer rounded px-2 py-1 hover:bg-gray-100 dark:hover:bg-gray-700", classes?.polite) })}
482
+ aria-live="polite"
483
+ onclick={(event: MouseEvent) => toggleMonthSelector(event)}
484
+ >
422
485
  {currentMonth.toLocaleString(translationLocale, { month: "long", year: "numeric" })}
423
486
  </Button>
424
487
  {@render navButton(true)}
@@ -6,7 +6,11 @@
6
6
 
7
7
  let { children, class: className, classes, divClass, div2Class, div3Class, div4Class, div5Class, div6Class, div7Class, ...restProps }: AndroidProps = $props();
8
8
 
9
- warnThemeDeprecation("Android", { divClass, div2Class, div3Class, div4Class, div5Class, div6Class, div7Class }, { divClass: "class", div2Class: "top", div3Class: "leftTop", div4Class: "leftMid", div5Class: "leftBot", div6Class: "right", div7Class: "slot" });
9
+ warnThemeDeprecation(
10
+ "Android",
11
+ { divClass, div2Class, div3Class, div4Class, div5Class, div6Class, div7Class },
12
+ { divClass: "class", div2Class: "top", div3Class: "leftTop", div4Class: "leftMid", div5Class: "leftBot", div6Class: "right", div7Class: "slot" }
13
+ );
10
14
 
11
15
  const styling = $derived(
12
16
  classes ?? {
@@ -6,7 +6,11 @@
6
6
 
7
7
  let { children, class: className, classes, divClass, div2Class, div3Class, div4Class, div5Class, div6Class, ...restProps }: DefaultMockupProps = $props();
8
8
 
9
- warnThemeDeprecation("DefaultMockup", { divClass, div2Class, div3Class, div4Class, div5Class, div6Class }, { divClass: "class", div2Class: "top", div3Class: "leftTop", div4Class: "leftBot", div5Class: "right", div6Class: "slot" });
9
+ warnThemeDeprecation(
10
+ "DefaultMockup",
11
+ { divClass, div2Class, div3Class, div4Class, div5Class, div6Class },
12
+ { divClass: "class", div2Class: "top", div3Class: "leftTop", div4Class: "leftBot", div5Class: "right", div6Class: "slot" }
13
+ );
10
14
  const styling = $derived(
11
15
  classes ?? {
12
16
  top: div2Class,
@@ -6,7 +6,11 @@
6
6
 
7
7
  let { children, class: className, classes, divClass, div2Class, div3Class, div4Class, div5Class, div6Class, ...restProps }: IosProps = $props();
8
8
 
9
- warnThemeDeprecation("Ios", { divClass, div2Class, div3Class, div4Class, div5Class, div6Class }, { divClass: "class", div2Class: "top", div3Class: "lefttop", div4Class: "leftBot", div5Class: "right", div6Class: "slot" });
9
+ warnThemeDeprecation(
10
+ "Ios",
11
+ { divClass, div2Class, div3Class, div4Class, div5Class, div6Class },
12
+ { divClass: "class", div2Class: "top", div3Class: "lefttop", div4Class: "leftBot", div5Class: "right", div6Class: "slot" }
13
+ );
10
14
  const styling = $derived(
11
15
  classes ?? {
12
16
  top: div2Class,
@@ -6,7 +6,11 @@
6
6
 
7
7
  let { children, class: className, classes, divClass, div2Class, div3Class, div4Class, ...restProps }: LaptopProps = $props();
8
8
 
9
- warnThemeDeprecation("Laptop", { divClass, div2Class, div3Class, div4Class }, { divClass: "class", div2Class: "top", div3Class: "lefttop", div4Class: "leftBot", div5Class: "right", div6Class: "slot" });
9
+ warnThemeDeprecation(
10
+ "Laptop",
11
+ { divClass, div2Class, div3Class, div4Class },
12
+ { divClass: "class", div2Class: "top", div3Class: "lefttop", div4Class: "leftBot", div5Class: "right", div6Class: "slot" }
13
+ );
10
14
  const styling = $derived(
11
15
  classes ?? {
12
16
  inner: div2Class,
@@ -6,7 +6,11 @@
6
6
 
7
7
  let { children, class: className, classes, divClass, div2Class, div3Class, div4Class, div5Class, div6Class, ...restProps }: SmartwatchProps = $props();
8
8
 
9
- warnThemeDeprecation("Smartwatch", { divClass, div2Class, div3Class, div4Class, div5Class, div6Class }, { divClass: "class", div2Class: "top", div3Class: "rightTop", div4Class: "rightBot", div5Class: "bot", div6Class: "slot" });
9
+ warnThemeDeprecation(
10
+ "Smartwatch",
11
+ { divClass, div2Class, div3Class, div4Class, div5Class, div6Class },
12
+ { divClass: "class", div2Class: "top", div3Class: "rightTop", div4Class: "rightBot", div5Class: "bot", div6Class: "slot" }
13
+ );
10
14
  const styling = $derived(
11
15
  classes ?? {
12
16
  top: div2Class,
@@ -6,7 +6,11 @@
6
6
 
7
7
  let { children, class: className, classes, divClass, div2Class, div3Class, div4Class, div5Class, div6Class, ...restProps }: TabletProps = $props();
8
8
 
9
- warnThemeDeprecation("Tablet", { divClass, div2Class, div3Class, div4Class, div5Class, div6Class }, { divClass: "class", div2Class: "leftTop", div3Class: "leftMid", div4Class: "leftBot", div5Class: "right", div6Class: "slot" });
9
+ warnThemeDeprecation(
10
+ "Tablet",
11
+ { divClass, div2Class, div3Class, div4Class, div5Class, div6Class },
12
+ { divClass: "class", div2Class: "leftTop", div3Class: "leftMid", div4Class: "leftBot", div5Class: "right", div6Class: "slot" }
13
+ );
10
14
  const styling = $derived(
11
15
  classes ?? {
12
16
  leftTop: div2Class,
@@ -8,13 +8,32 @@
8
8
  import { fade } from "svelte/transition";
9
9
  import { dialog } from "./theme";
10
10
 
11
- let { children, onaction = () => true, oncancel, onsubmit, ontoggle, form = false, modal = true, autoclose = false, focustrap = false, open = $bindable(false), permanent = false, dismissable = true, outsideclose = true, class: className, classes, transition = fade, transitionParams, ...restProps }: DialogProps = $props();
11
+ let {
12
+ children,
13
+ onaction = () => true,
14
+ oncancel,
15
+ onsubmit,
16
+ ontoggle,
17
+ form = false,
18
+ modal = true,
19
+ autoclose = false,
20
+ focustrap = false,
21
+ open = $bindable(false),
22
+ permanent = false,
23
+ dismissable = true,
24
+ outsideclose = true,
25
+ class: className,
26
+ classes,
27
+ transition = fade,
28
+ transitionParams,
29
+ ...restProps
30
+ }: DialogProps = $props();
12
31
 
13
32
  const paramsOptions = $derived(transitionParams ?? { duration: 100, easing: sineIn });
14
33
 
15
34
  let { base, form: formCls, close: closeCls } = dialog();
16
35
 
17
- const close = (dlg: HTMLDialogElement) => (open = false);
36
+ const close = () => (open = false);
18
37
 
19
38
  // Prefer requestClose when available to trigger a cancellable "cancel" event; otherwise synthesize it.
20
39
  const cancel = (dlg: HTMLDialogElement) => {
@@ -34,7 +53,7 @@
34
53
  if (ev.defaultPrevented) return;
35
54
 
36
55
  ev.preventDefault(); // prevent anyway, we need clean close
37
- if (!permanent) close(ev.currentTarget);
56
+ if (!permanent) close();
38
57
  }
39
58
 
40
59
  function _onclick(ev: MouseEvent & { currentTarget: HTMLDialogElement }) {
@@ -50,7 +69,7 @@
50
69
  }
51
70
 
52
71
  if (autoclose && ev.target instanceof HTMLButtonElement && !permanent) {
53
- return close(dlg);
72
+ return close();
54
73
  }
55
74
  }
56
75
 
@@ -82,7 +101,7 @@
82
101
  if (result === false) return;
83
102
  }
84
103
 
85
- close(dlg);
104
+ close();
86
105
  }
87
106
 
88
107
  function _ontoggle(ev: ToggleEvent & { currentTarget: HTMLDialogElement }) {
@@ -112,7 +131,7 @@
112
131
 
113
132
  let ref: HTMLDialogElement | undefined = $state(undefined);
114
133
 
115
- function close_handler(ev: MouseEvent) {
134
+ function close_handler() {
116
135
  if (form) {
117
136
  // dialog/form mechanism will close the dialog
118
137
  return;
@@ -132,7 +151,19 @@
132
151
  {/snippet}
133
152
 
134
153
  {#if open}
135
- <dialog {@attach init} bind:this={ref} use:focusTrap tabindex="-1" onsubmit={_onsubmit} oncancel={_oncancel} onclick={_onclick} ontoggle={_ontoggle} transition:transition|global={paramsOptions as ParamsType} {...restProps} class={base({ class: clsx(className) })}>
154
+ <dialog
155
+ {@attach init}
156
+ bind:this={ref}
157
+ use:focusTrap
158
+ tabindex="-1"
159
+ onsubmit={_onsubmit}
160
+ oncancel={_oncancel}
161
+ onclick={_onclick}
162
+ ontoggle={_ontoggle}
163
+ transition:transition|global={paramsOptions as ParamsType}
164
+ {...restProps}
165
+ class={base({ class: clsx(className) })}
166
+ >
136
167
  {#if form}
137
168
  <form method="dialog" class={formCls({ class: clsx(classes?.form) })}>
138
169
  {@render content()}
@@ -8,7 +8,22 @@
8
8
  import { drawer } from "./theme";
9
9
  import { setContext, tick } from "svelte";
10
10
 
11
- let { children, open = $bindable(false), hidden = $bindable(), modal, offset, width, dismissable = offset ? false : undefined, placement = "left", class: className, transitionParams, transition = fly, outsideclose, activateClickOutside, ...restProps }: DrawerProps = $props();
11
+ let {
12
+ children,
13
+ open = $bindable(false),
14
+ hidden = $bindable(),
15
+ modal,
16
+ offset,
17
+ width,
18
+ dismissable = offset ? false : undefined,
19
+ placement = "left",
20
+ class: className,
21
+ transitionParams,
22
+ transition = fly,
23
+ outsideclose,
24
+ activateClickOutside,
25
+ ...restProps
26
+ }: DrawerProps = $props();
12
27
 
13
28
  setContext("drawer", {
14
29
  get placement() {
@@ -94,7 +109,19 @@
94
109
  }
95
110
  </script>
96
111
 
97
- <Dialog {@attach init} bind:open {modal} {dismissable} {transition} {outsideclose} transitionParams={transition_params} {...restProps} {onintrostart} {onoutrostart} class={base({ class: clsx(theme?.base, className) })}>
112
+ <Dialog
113
+ {@attach init}
114
+ bind:open
115
+ {modal}
116
+ {dismissable}
117
+ {transition}
118
+ {outsideclose}
119
+ transitionParams={transition_params}
120
+ {...restProps}
121
+ {onintrostart}
122
+ {onoutrostart}
123
+ class={base({ class: clsx(theme?.base, className) })}
124
+ >
98
125
  {@render children?.()}
99
126
  </Dialog>
100
127
 
@@ -35,7 +35,15 @@
35
35
  });
36
36
  </script>
37
37
 
38
- <button type="button" class={button({ selected, color: actualColor, size, roundedSize, class: clsx(theme?.button, ctxBtnClass, className) })} data-selected={selected} onclick={handleClick} role={multiSelect ? "checkbox" : "radio"} aria-checked={selected} {...restProps}>
38
+ <button
39
+ type="button"
40
+ class={button({ selected, color: actualColor, size, roundedSize, class: clsx(theme?.button, ctxBtnClass, className) })}
41
+ data-selected={selected}
42
+ onclick={handleClick}
43
+ role={multiSelect ? "checkbox" : "radio"}
44
+ aria-checked={selected}
45
+ {...restProps}
46
+ >
39
47
  <div class={content({ class: clsx(theme?.content, styling.content) })}>
40
48
  {#if selected}
41
49
  {#if iconSlot}
@@ -5,7 +5,20 @@
5
5
  import { buttonToggleGroup } from "./theme";
6
6
  import { getTheme } from "../../theme/themeUtils";
7
7
 
8
- let { multiSelect = false, name = "toggle-group", value = multiSelect ? [] : null, color, size = "md", roundedSize = "md", onSelect = () => {}, children, ctxIconClass, ctxBtnClass, class: className, ...restProps }: ButtonToggleGroupProps = $props();
8
+ let {
9
+ multiSelect = false,
10
+ name = "toggle-group",
11
+ value = multiSelect ? [] : null,
12
+ color,
13
+ size = "md",
14
+ roundedSize = "md",
15
+ onSelect = () => {},
16
+ children,
17
+ ctxIconClass,
18
+ ctxBtnClass,
19
+ class: className,
20
+ ...restProps
21
+ }: ButtonToggleGroupProps = $props();
9
22
 
10
23
  const theme = getTheme("buttonToggleGroup");
11
24
 
@@ -4,7 +4,19 @@
4
4
  let { class: className, ...restProps }: CheckIconProps = $props();
5
5
  </script>
6
6
 
7
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class={clsx(className)} {...restProps}>
7
+ <svg
8
+ xmlns="http://www.w3.org/2000/svg"
9
+ width="16"
10
+ height="16"
11
+ viewBox="0 0 24 24"
12
+ fill="none"
13
+ stroke="currentColor"
14
+ stroke-width="2"
15
+ stroke-linecap="round"
16
+ stroke-linejoin="round"
17
+ class={clsx(className)}
18
+ {...restProps}
19
+ >
8
20
  <polyline points="20 6 9 17 4 12"></polyline>
9
21
  </svg>
10
22
 
@@ -5,7 +5,24 @@
5
5
  import Label from "../label/Label.svelte";
6
6
  import { getTheme, warnThemeDeprecation } from "../../theme/themeUtils";
7
7
 
8
- let { children, color = "primary", custom, inline, tinted, rounded, group = $bindable([]), choices = [], checked = $bindable(false), classes, class: className, divClass, disabled, value, labelProps = {}, ...restProps }: CheckboxProps = $props();
8
+ let {
9
+ children,
10
+ color = "primary",
11
+ custom,
12
+ inline,
13
+ tinted,
14
+ rounded,
15
+ group = $bindable([]),
16
+ choices = [],
17
+ checked = $bindable(false),
18
+ classes,
19
+ class: className,
20
+ divClass,
21
+ disabled,
22
+ value,
23
+ labelProps = {},
24
+ ...restProps
25
+ }: CheckboxProps = $props();
9
26
 
10
27
  warnThemeDeprecation("Checkbox", { divClass }, { divClass: "div" });
11
28
  const styling = $derived(classes ?? { div: divClass });
@@ -6,7 +6,20 @@
6
6
  import { getTheme, warnThemeDeprecation } from "../../theme/themeUtils";
7
7
  import { createDismissableContext } from "../../utils/dismissable";
8
8
 
9
- let { files = $bindable(), size = "md", clearable = false, elementRef = $bindable(), class: className, classes, clearableSvgClass, clearableColor = "none", clearableClass, clearableOnClick, wrapperClass, ...restProps }: FileuploadProps = $props();
9
+ let {
10
+ files = $bindable(),
11
+ size = "md",
12
+ clearable = false,
13
+ elementRef = $bindable(),
14
+ class: className,
15
+ classes,
16
+ clearableSvgClass,
17
+ clearableColor = "none",
18
+ clearableClass,
19
+ clearableOnClick,
20
+ wrapperClass,
21
+ ...restProps
22
+ }: FileuploadProps = $props();
10
23
 
11
24
  warnThemeDeprecation("Fileupload", { wrapperClass, clearableClass, clearableSvgClass }, { wrapperClass: "wrapper", clearableClass: "close", clearableSvgClass: "svg" });
12
25
  const styling = $derived(classes ?? { wrapper: wrapperClass, close: clearableClass, svg: clearableSvgClass });