flowbite-svelte 1.0.0 → 1.0.2

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 (184) hide show
  1. package/dist/accordion/AccordionItem.svelte +1 -1
  2. package/dist/carousel/ControlButton.svelte +3 -1
  3. package/dist/carousel/Controls.svelte +4 -3
  4. package/dist/carousel/Controls.svelte.d.ts +1 -0
  5. package/dist/datepicker/Datepicker.svelte +1 -3
  6. package/dist/datepicker/Datepicker.svelte.d.ts +1 -1
  7. package/dist/forms/textarea/Textarea.svelte +1 -1
  8. package/dist/forms/textarea/Textarea.svelte.d.ts +1 -1
  9. package/dist/forms/timepicker/Timepicker.svelte +223 -0
  10. package/dist/forms/timepicker/Timepicker.svelte.d.ts +33 -0
  11. package/dist/forms/timepicker/index.d.ts +2 -0
  12. package/dist/forms/timepicker/index.js +3 -0
  13. package/dist/forms/toggle/Toggle.svelte +1 -1
  14. package/dist/forms/toggle/Toggle.svelte.d.ts +1 -1
  15. package/dist/gallery/Gallery.svelte +1 -1
  16. package/dist/gallery/Gallery.svelte.d.ts +1 -1
  17. package/dist/index.d.ts +2 -0
  18. package/dist/index.js +2 -0
  19. package/dist/indicator/Indicator.svelte +1 -1
  20. package/dist/indicator/Indicator.svelte.d.ts +1 -1
  21. package/dist/kbd/Kbd.svelte +1 -1
  22. package/dist/kbd/Kbd.svelte.d.ts +1 -1
  23. package/dist/list-group/Listgroup.svelte +1 -1
  24. package/dist/list-group/Listgroup.svelte.d.ts +1 -1
  25. package/dist/list-group/ListgroupItem.svelte +1 -1
  26. package/dist/list-group/ListgroupItem.svelte.d.ts +1 -1
  27. package/dist/mega-menu/MegaMenu.svelte +1 -1
  28. package/dist/mega-menu/MegaMenu.svelte.d.ts +1 -1
  29. package/dist/modal/Modal.svelte +1 -1
  30. package/dist/modal/Modal.svelte.d.ts +1 -1
  31. package/dist/navbar/Menu.svelte +1 -1
  32. package/dist/navbar/Menu.svelte.d.ts +1 -1
  33. package/dist/navbar/NavBrand.svelte +1 -1
  34. package/dist/navbar/NavBrand.svelte.d.ts +1 -1
  35. package/dist/navbar/NavContainer.svelte +1 -1
  36. package/dist/navbar/NavContainer.svelte.d.ts +1 -1
  37. package/dist/navbar/NavHamburger.svelte +1 -1
  38. package/dist/navbar/NavHamburger.svelte.d.ts +1 -1
  39. package/dist/navbar/NavLi.svelte +1 -1
  40. package/dist/navbar/NavLi.svelte.d.ts +1 -1
  41. package/dist/navbar/NavUl.svelte +1 -1
  42. package/dist/navbar/NavUl.svelte.d.ts +1 -1
  43. package/dist/navbar/Navbar.svelte +1 -1
  44. package/dist/navbar/Navbar.svelte.d.ts +1 -1
  45. package/dist/pagination/Pagination.svelte +1 -1
  46. package/dist/pagination/Pagination.svelte.d.ts +1 -1
  47. package/dist/pagination/PaginationItem.svelte +1 -1
  48. package/dist/pagination/PaginationItem.svelte.d.ts +1 -1
  49. package/dist/popover/Popover.svelte +1 -1
  50. package/dist/popover/Popover.svelte.d.ts +1 -1
  51. package/dist/progress/Progressbar.svelte +1 -1
  52. package/dist/progress/Progressbar.svelte.d.ts +1 -1
  53. package/dist/rating/AdvancedRating.svelte +1 -1
  54. package/dist/rating/AdvancedRating.svelte.d.ts +1 -1
  55. package/dist/rating/CustomIcon.svelte +1 -1
  56. package/dist/rating/CustomIcon.svelte.d.ts +1 -1
  57. package/dist/rating/Heart.svelte +1 -1
  58. package/dist/rating/Heart.svelte.d.ts +1 -1
  59. package/dist/rating/Rating.svelte +1 -1
  60. package/dist/rating/Rating.svelte.d.ts +1 -1
  61. package/dist/rating/RatingComment.svelte +1 -1
  62. package/dist/rating/RatingComment.svelte.d.ts +1 -1
  63. package/dist/rating/Review.svelte +1 -1
  64. package/dist/rating/Review.svelte.d.ts +1 -1
  65. package/dist/rating/ScoreRating.svelte +1 -1
  66. package/dist/rating/ScoreRating.svelte.d.ts +1 -1
  67. package/dist/rating/Star.svelte +1 -1
  68. package/dist/rating/Star.svelte.d.ts +1 -1
  69. package/dist/rating/Thumbup.svelte +1 -1
  70. package/dist/rating/Thumbup.svelte.d.ts +1 -1
  71. package/dist/sidebar/Sidebar.svelte +1 -1
  72. package/dist/sidebar/Sidebar.svelte.d.ts +1 -1
  73. package/dist/sidebar/SidebarBrand.svelte +1 -1
  74. package/dist/sidebar/SidebarBrand.svelte.d.ts +1 -1
  75. package/dist/sidebar/SidebarButton.svelte +1 -1
  76. package/dist/sidebar/SidebarButton.svelte.d.ts +1 -1
  77. package/dist/sidebar/SidebarCta.svelte +1 -1
  78. package/dist/sidebar/SidebarCta.svelte.d.ts +1 -1
  79. package/dist/sidebar/SidebarDropdownWrapper.svelte +1 -1
  80. package/dist/sidebar/SidebarDropdownWrapper.svelte.d.ts +1 -1
  81. package/dist/sidebar/SidebarGroup.svelte +1 -1
  82. package/dist/sidebar/SidebarGroup.svelte.d.ts +1 -1
  83. package/dist/sidebar/SidebarItem.svelte +1 -1
  84. package/dist/sidebar/SidebarItem.svelte.d.ts +1 -1
  85. package/dist/skeleton/CardPlaceholder.svelte +1 -1
  86. package/dist/skeleton/CardPlaceholder.svelte.d.ts +1 -1
  87. package/dist/skeleton/ImagePlaceholder.svelte +1 -1
  88. package/dist/skeleton/ImagePlaceholder.svelte.d.ts +1 -1
  89. package/dist/skeleton/ListPlaceholder.svelte +1 -1
  90. package/dist/skeleton/ListPlaceholder.svelte.d.ts +1 -1
  91. package/dist/skeleton/Skeleton.svelte +1 -1
  92. package/dist/skeleton/Skeleton.svelte.d.ts +1 -1
  93. package/dist/skeleton/TextPlaceholder.svelte +1 -1
  94. package/dist/skeleton/TextPlaceholder.svelte.d.ts +1 -1
  95. package/dist/skeleton/VideoPlaceholder.svelte +1 -1
  96. package/dist/skeleton/VideoPlaceholder.svelte.d.ts +1 -1
  97. package/dist/speed-dial/SpeedDial.svelte +1 -1
  98. package/dist/speed-dial/SpeedDial.svelte.d.ts +1 -1
  99. package/dist/speed-dial/SpeedDialButton.svelte +1 -1
  100. package/dist/speed-dial/SpeedDialButton.svelte.d.ts +1 -1
  101. package/dist/speed-dial/SpeedDialTrigger.svelte +1 -1
  102. package/dist/speed-dial/SpeedDialTrigger.svelte.d.ts +1 -1
  103. package/dist/spinner/Spinner.svelte +1 -1
  104. package/dist/spinner/Spinner.svelte.d.ts +1 -1
  105. package/dist/steps/StepIndicator.svelte +87 -0
  106. package/dist/steps/StepIndicator.svelte.d.ts +20 -0
  107. package/dist/steps/index.d.ts +1 -0
  108. package/dist/steps/index.js +1 -0
  109. package/dist/table/Table.svelte +1 -1
  110. package/dist/table/Table.svelte.d.ts +1 -1
  111. package/dist/table/TableBody.svelte +1 -1
  112. package/dist/table/TableBody.svelte.d.ts +1 -1
  113. package/dist/table/TableBodyCell.svelte +1 -1
  114. package/dist/table/TableBodyCell.svelte.d.ts +1 -1
  115. package/dist/table/TableBodyRow.svelte +1 -1
  116. package/dist/table/TableBodyRow.svelte.d.ts +1 -1
  117. package/dist/table/TableHead.svelte +1 -1
  118. package/dist/table/TableHead.svelte.d.ts +1 -1
  119. package/dist/table/TableHeadCell.svelte +1 -1
  120. package/dist/table/TableHeadCell.svelte.d.ts +1 -1
  121. package/dist/table/TableSearch.svelte +1 -1
  122. package/dist/table/TableSearch.svelte.d.ts +1 -1
  123. package/dist/tabs/TabItem.svelte +1 -1
  124. package/dist/tabs/TabItem.svelte.d.ts +1 -1
  125. package/dist/tabs/Tabs.svelte +1 -1
  126. package/dist/tabs/Tabs.svelte.d.ts +1 -1
  127. package/dist/theme/Theme.svelte +1 -1
  128. package/dist/theme/Theme.svelte.d.ts +1 -1
  129. package/dist/timeline/Activity.svelte +1 -1
  130. package/dist/timeline/Activity.svelte.d.ts +1 -1
  131. package/dist/timeline/ActivityItem.svelte +1 -1
  132. package/dist/timeline/ActivityItem.svelte.d.ts +1 -1
  133. package/dist/timeline/Group.svelte +1 -1
  134. package/dist/timeline/Group.svelte.d.ts +1 -1
  135. package/dist/timeline/GroupItem.svelte +1 -1
  136. package/dist/timeline/GroupItem.svelte.d.ts +1 -1
  137. package/dist/timeline/Timeline.svelte +1 -1
  138. package/dist/timeline/Timeline.svelte.d.ts +1 -1
  139. package/dist/timeline/TimelineItem.svelte +1 -1
  140. package/dist/timeline/TimelineItem.svelte.d.ts +1 -1
  141. package/dist/toast/Toast.svelte +1 -1
  142. package/dist/toast/Toast.svelte.d.ts +1 -1
  143. package/dist/toolbar/Toolbar.svelte +1 -1
  144. package/dist/toolbar/Toolbar.svelte.d.ts +1 -1
  145. package/dist/toolbar/ToolbarButton.svelte +1 -1
  146. package/dist/toolbar/ToolbarButton.svelte.d.ts +1 -1
  147. package/dist/toolbar/ToolbarGroup.svelte +1 -1
  148. package/dist/toolbar/ToolbarGroup.svelte.d.ts +1 -1
  149. package/dist/tooltip/Tooltip.svelte +1 -1
  150. package/dist/tooltip/Tooltip.svelte.d.ts +1 -1
  151. package/dist/types.d.ts +51 -4
  152. package/dist/typography/anchor/A.svelte +1 -1
  153. package/dist/typography/anchor/A.svelte.d.ts +1 -1
  154. package/dist/typography/blockquote/Blockquote.svelte +1 -1
  155. package/dist/typography/blockquote/Blockquote.svelte.d.ts +1 -1
  156. package/dist/typography/descriptionlist/DescriptionList.svelte +1 -1
  157. package/dist/typography/descriptionlist/DescriptionList.svelte.d.ts +1 -1
  158. package/dist/typography/heading/Heading.svelte +1 -1
  159. package/dist/typography/heading/Heading.svelte.d.ts +1 -1
  160. package/dist/typography/hr/Hr.svelte +1 -1
  161. package/dist/typography/hr/Hr.svelte.d.ts +1 -1
  162. package/dist/typography/img/EnhancedImg.svelte +1 -1
  163. package/dist/typography/img/EnhancedImg.svelte.d.ts +1 -1
  164. package/dist/typography/img/Img.svelte +1 -1
  165. package/dist/typography/img/Img.svelte.d.ts +1 -1
  166. package/dist/typography/layout/Layout.svelte +1 -1
  167. package/dist/typography/layout/Layout.svelte.d.ts +1 -1
  168. package/dist/typography/list/Li.svelte +1 -1
  169. package/dist/typography/list/Li.svelte.d.ts +1 -1
  170. package/dist/typography/list/List.svelte +1 -1
  171. package/dist/typography/list/List.svelte.d.ts +1 -1
  172. package/dist/typography/mark/Mark.svelte +1 -1
  173. package/dist/typography/mark/Mark.svelte.d.ts +1 -1
  174. package/dist/typography/paragraph/P.svelte +1 -1
  175. package/dist/typography/paragraph/P.svelte.d.ts +1 -1
  176. package/dist/typography/secondary/Secondary.svelte +1 -1
  177. package/dist/typography/secondary/Secondary.svelte.d.ts +1 -1
  178. package/dist/typography/span/Span.svelte +1 -1
  179. package/dist/typography/span/Span.svelte.d.ts +1 -1
  180. package/dist/utils/Popper.svelte +4 -3
  181. package/dist/utils/Popper.svelte.d.ts +2 -1
  182. package/dist/video/Video.svelte +1 -1
  183. package/dist/video/Video.svelte.d.ts +1 -1
  184. package/package.json +10 -2
@@ -33,7 +33,7 @@
33
33
  </script>
34
34
 
35
35
  <h2 class={base()}>
36
- <button onclick={handleToggle} class={buttonClass} aria-expanded={open}>
36
+ <button type="button" onclick={handleToggle} class={buttonClass} aria-expanded={open}>
37
37
  {#if header}
38
38
  {@render header()}
39
39
  {#if open}
@@ -20,7 +20,9 @@
20
20
  <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7" />
21
21
  </svg>
22
22
  {/if}
23
- <span class="sr-only">{name}</span>
23
+ {#if name}
24
+ <span class="sr-only">{name}</span>
25
+ {/if}
24
26
  </span>
25
27
  {/if}
26
28
  </button>
@@ -5,7 +5,7 @@
5
5
  import ControlButton from "./ControlButton.svelte";
6
6
  import type { State, ControlsProps } from "../types";
7
7
 
8
- let { children, class: className }: ControlsProps = $props();
8
+ let { children, class: className, ...restProps }: ControlsProps = $props();
9
9
 
10
10
  const state = getContext<Writable<State>>("state");
11
11
  const { update } = state;
@@ -43,8 +43,8 @@
43
43
  {#if children}
44
44
  {@render children(changeSlide)}
45
45
  {:else}
46
- <ControlButton name="Previous" forward={false} onclick={() => changeSlide(false)} class={className} />
47
- <ControlButton name="Next" forward={true} onclick={() => changeSlide(true)} class={className} />
46
+ <ControlButton name="Previous" forward={false} onclick={() => changeSlide(false)} class={className} {...restProps} />
47
+ <ControlButton name="Next" forward={true} onclick={() => changeSlide(true)} class={className} {...restProps} />
48
48
  {/if}
49
49
 
50
50
  <!--
@@ -55,4 +55,5 @@
55
55
  ## Props
56
56
  @prop children
57
57
  @prop class: className
58
+ @prop ...restProps
58
59
  -->
@@ -6,6 +6,7 @@ import type { ControlsProps } from "../types";
6
6
  * ## Props
7
7
  * @prop children
8
8
  * @prop class: className
9
+ * @prop ...restProps
9
10
  */
10
11
  declare const Controls: import("svelte").Component<ControlsProps, {}, "">;
11
12
  type Controls = ReturnType<typeof Controls>;
@@ -1,10 +1,8 @@
1
1
  <script lang="ts">
2
2
  import { onMount } from "svelte";
3
3
  import { fade } from "svelte/transition";
4
- import { Button } from "..";
5
- import type { DatepickerProps } from "../types";
4
+ import { Button, ToolbarButton, type DatepickerProps } from "..";
6
5
  import { datepicker } from "./theme";
7
- import ToolbarButton from "../toolbar/ToolbarButton.svelte";
8
6
 
9
7
  let { value = $bindable(), defaultDate = null, range = false, rangeFrom = $bindable(), rangeTo = $bindable(), locale = "default", firstDayOfWeek = 0, dateFormat, placeholder = "Select date", disabled = false, required = false, inputClass = "", color = "primary", inline = false, autohide = true, showActionButtons = false, title = "", onselect, onclear, onapply }: DatepickerProps = $props();
10
8
 
@@ -1,4 +1,4 @@
1
- import type { DatepickerProps } from "../types";
1
+ import { type DatepickerProps } from "..";
2
2
  /**
3
3
  * [Go to docs](https://flowbite-svelte.com/)
4
4
  * ## Type
@@ -37,7 +37,7 @@
37
37
  @component
38
38
  [Go to docs](https://flowbite-svelte.com/)
39
39
  ## Type
40
- [TextareaProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L790)
40
+ [TextareaProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L825)
41
41
  ## Props
42
42
  @prop header
43
43
  @prop footer
@@ -2,7 +2,7 @@ import type { TextareaProps } from "../../types";
2
2
  /**
3
3
  * [Go to docs](https://flowbite-svelte.com/)
4
4
  * ## Type
5
- * [TextareaProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L790)
5
+ * [TextareaProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L825)
6
6
  * ## Props
7
7
  * @prop header
8
8
  * @prop footer
@@ -0,0 +1,223 @@
1
+ <script lang="ts">
2
+ import { twMerge } from "tailwind-merge";
3
+ import { Dropdown, DropdownItem, Button, Input, ButtonGroup, Select, InputAddon, Label, Toggle, type TimepickerProps, type TimePickerOption } from "../..";
4
+
5
+ // Props
6
+ let { id = "time", endId = "end-time", value = "00:00", endValue = "00:00", min = "", max = "", required = true, disabled = false, inputColor, buttonColor = "primary", Icon, type = "default", optionLabel = "Options", options = [], size = "md", divClass = "inline-flex rounded-lg shadow-sm", inputClass, selectClass, timerangeLabel = "Choose time range", timerangeButtonLabel = "Save time", timeIntervals = [], columns = 2, onselect }: TimepickerProps = $props();
7
+
8
+ const defaultInputClass = "block disabled:cursor-not-allowed disabled:opacity-50 rtl:text-right focus:ring-0 focus:outline-none p-2.5 border-r-0";
9
+ const inputCls = twMerge(defaultInputClass, inputClass);
10
+ const defaultSelectClass = "text-gray-900 disabled:text-gray-400 bg-gray-50 border border-gray-300 rounded-r-lg rounded-l-none focus:ring-0 focus:outline-none block w-full p-2.5 border-l-1 focus:ring-primary-500 focus:border-primary-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:disabled:text-gray-500 dark:focus:ring-primary-500 dark:focus:border-primary-500";
11
+ const selectCls = twMerge(defaultSelectClass, selectClass);
12
+
13
+ // State
14
+ // let value = $state("00:00");
15
+ // let endValue = $state("00:00");
16
+ let selectedOption = $state("");
17
+ let dropdownOpen = $state(false);
18
+ let showTimerange = $state(false);
19
+
20
+ function timeToMinutes(time: string): number {
21
+ const [hours, minutes] = time.split(":").map(Number);
22
+ return hours * 60 + minutes;
23
+ }
24
+
25
+ function handleTimeChange(event: Event, isEndTime: boolean = false): void {
26
+ const target = event.target as HTMLInputElement;
27
+ const newValue = target.value;
28
+ const newMinutes = timeToMinutes(newValue);
29
+ const valueMinutes = timeToMinutes(value);
30
+ const endValueMinutes = timeToMinutes(endValue);
31
+
32
+ if (isEndTime) {
33
+ if (newMinutes < valueMinutes) {
34
+ value = newValue;
35
+ } else {
36
+ endValue = newValue;
37
+ }
38
+ } else {
39
+ if (newMinutes > endValueMinutes) {
40
+ endValue = newValue;
41
+ } else {
42
+ value = newValue;
43
+ }
44
+ }
45
+
46
+ if (type !== "timerange-dropdown") {
47
+ notifyChange();
48
+ }
49
+ }
50
+
51
+ function handleOptionSelect(event: Event): void {
52
+ const target = event.target as HTMLSelectElement;
53
+ selectedOption = target.value;
54
+ notifyChange();
55
+ }
56
+
57
+ function handleDropdownSelect(option: TimePickerOption): void {
58
+ dropdownOpen = false;
59
+ selectedOption = option.value;
60
+ notifyChange();
61
+ }
62
+
63
+ function notifyChange(): void {
64
+ if (onselect) {
65
+ onselect({
66
+ time: value,
67
+ endTime: endValue,
68
+ [optionLabel ? optionLabel.toLowerCase() : "options"]: selectedOption || options[0]?.value || ""
69
+ });
70
+ }
71
+ }
72
+
73
+ function applyTimerange(): void {
74
+ dropdownOpen = false;
75
+ notifyChange();
76
+ }
77
+
78
+ function toggleTimerange(): void {
79
+ showTimerange = !showTimerange;
80
+ if (!showTimerange) {
81
+ notifyChange();
82
+ }
83
+ }
84
+
85
+ function handleInlineButtonSelect(time: string): void {
86
+ value = time;
87
+ notifyChange();
88
+ }
89
+ </script>
90
+
91
+ {#if type !== "inline-buttons"}
92
+ <ButtonGroup {size} class={divClass}>
93
+ {#if type === "default"}
94
+ <Input {id} color={inputColor} type="time" {min} {max} {required} {disabled} class="{inputCls} rounded-l-lg" bind:value onchange={(e) => handleTimeChange(e)} />
95
+ <InputAddon class="rounded-r-lg">
96
+ {#if Icon}
97
+ <Icon class="h-4 w-4 text-gray-500 dark:text-gray-400" />
98
+ {:else}
99
+ <svg class="h-4 w-4 text-gray-500 dark:text-gray-400" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 20 20">
100
+ <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6v4l3.276 3.276M19 10a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" />
101
+ </svg>
102
+ {/if}
103
+ </InputAddon>
104
+ {:else if type === "select"}
105
+ <Input {id} color={inputColor} type="time" {min} {max} {required} {disabled} class="{inputCls} w-1/3 rounded-l-lg" bind:value onchange={(e) => handleTimeChange(e)} />
106
+ <Select class={selectCls} onchange={handleOptionSelect} items={options} value={selectedOption} />
107
+ {:else if type === "dropdown"}
108
+ <Input {id} color={inputColor} type="time" {min} {max} {required} {disabled} class="{inputCls} rounded-l-lg" bind:value onchange={(e) => handleTimeChange(e)} />
109
+ <Button color={buttonColor} class="!rounded-r-lg">
110
+ {optionLabel}
111
+ <svg class="ml-2 h-4 w-4" aria-hidden="true" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path></svg>
112
+ </Button>
113
+ <Dropdown simple>
114
+ {#each options as option}
115
+ <DropdownItem onclick={() => handleDropdownSelect(option)}>
116
+ {option.name}
117
+ </DropdownItem>
118
+ {/each}
119
+ </Dropdown>
120
+ {:else if type === "range"}
121
+ <Input {id} color={inputColor} type="time" {min} {max} {required} {disabled} class="{inputCls} rounded-l-lg" bind:value onchange={(e) => handleTimeChange(e)} />
122
+ <InputAddon class="rounded-none">
123
+ {#if Icon}
124
+ <Icon class="h-4 w-4 text-gray-500 dark:text-gray-400" />
125
+ {:else}
126
+ <svg class="h-4 w-4 text-gray-500 dark:text-gray-400" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 20 20">
127
+ <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6v4l3.276 3.276M19 10a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" />
128
+ </svg>
129
+ {/if}
130
+ </InputAddon>
131
+ <span class="flex items-center justify-center px-2 text-gray-500 dark:text-gray-400">-</span>
132
+ <Input id={endId} color={inputColor} type="time" {min} {max} {required} {disabled} class="{inputCls} rounded-none" bind:value={endValue} onchange={(e) => handleTimeChange(e, true)} />
133
+ <InputAddon class="rounded-r-lg">
134
+ {#if Icon}
135
+ <Icon class="h-4 w-4 text-gray-500 dark:text-gray-400" />
136
+ {:else}
137
+ <svg class="h-4 w-4 text-gray-500 dark:text-gray-400" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 20 20">
138
+ <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6v4l3.276 3.276M19 10a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" />
139
+ </svg>
140
+ {/if}
141
+ </InputAddon>
142
+ {:else if type === "timerange-dropdown"}
143
+ <Button color={buttonColor} {size} class="!rounded-r-lg">
144
+ {timerangeLabel}
145
+ <svg class="ml-2 h-4 w-4" aria-hidden="true" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path></svg>
146
+ </Button>
147
+ <Dropdown simple class="p-4 last:rounded-r-lg">
148
+ <div class="flex flex-col space-y-4">
149
+ <div class="flex space-x-4">
150
+ <div class="flex flex-col">
151
+ <Label for={id}>Start time:</Label>
152
+ <Input {id} color={inputColor} type="time" {min} {max} {required} {disabled} class="{inputCls} rounded-l-lg border-r" bind:value onchange={(e) => handleTimeChange(e)} />
153
+ </div>
154
+ <div class="flex flex-col">
155
+ <Label for={endId}>End time:</Label>
156
+ <Input id={endId} color={inputColor} type="time" {min} {max} {required} {disabled} class="{inputCls} rounded-l-lg border-r" bind:value={endValue} onchange={(e) => handleTimeChange(e, true)} />
157
+ </div>
158
+ </div>
159
+ <Button color={buttonColor} class="w-full !rounded-l-lg" onclick={applyTimerange}>
160
+ {timerangeButtonLabel}
161
+ </Button>
162
+ </div>
163
+ </Dropdown>
164
+ {:else if type === "timerange-toggle"}
165
+ <div class="flex w-full flex-col space-y-2">
166
+ <div class="flex items-center justify-between">
167
+ <Toggle id={`${id}-timerange-toggle`} checked={showTimerange} onchange={toggleTimerange} spanClass="me-0" />
168
+ </div>
169
+ {#if showTimerange}
170
+ <div class="flex space-x-4">
171
+ <div class="flex flex-col">
172
+ <Label for={id}>Start time:</Label>
173
+ <Input {id} color={inputColor} type="time" {min} {max} {required} {disabled} class="{inputCls} !rounded-lg border-r-1" bind:value onchange={(e) => handleTimeChange(e)} />
174
+ </div>
175
+ <div class="flex flex-col">
176
+ <Label for={endId}>End time:</Label>
177
+ <Input id={endId} color={inputColor} type="time" {min} {max} {required} {disabled} class="{inputCls} !rounded-lg border-r-1" bind:value={endValue} onchange={(e) => handleTimeChange(e, true)} />
178
+ </div>
179
+ </div>
180
+ {/if}
181
+ </div>
182
+ {/if}
183
+ </ButtonGroup>
184
+ {:else}
185
+ <div class="grid w-full gap-2" class:grid-cols-1={columns === 1} class:grid-cols-2={columns === 2} class:grid-cols-3={columns === 3} class:grid-cols-4={columns === 4}>
186
+ {#each timeIntervals as time}
187
+ <Button {size} color={value === time ? buttonColor : "light"} class="rounded-lg" onclick={() => handleInlineButtonSelect(time)}>
188
+ {time}
189
+ </Button>
190
+ {/each}
191
+ </div>
192
+ {/if}
193
+
194
+ <!--
195
+ @component
196
+ [Go to docs](https://flowbite-svelte.com/)
197
+ ## Type
198
+ [TimepickerProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L797)
199
+ ## Props
200
+ @prop id = "time"
201
+ @prop endId = "end-time"
202
+ @prop value = "00:00"
203
+ @prop endValue = "00:00"
204
+ @prop min = ""
205
+ @prop max = ""
206
+ @prop required = true
207
+ @prop disabled = false
208
+ @prop inputColor
209
+ @prop buttonColor = "primary"
210
+ @prop Icon
211
+ @prop type = "default"
212
+ @prop optionLabel = "Options"
213
+ @prop options = []
214
+ @prop size = "md"
215
+ @prop divClass = "inline-flex rounded-lg shadow-sm"
216
+ @prop inputClass
217
+ @prop selectClass
218
+ @prop timerangeLabel = "Choose time range"
219
+ @prop timerangeButtonLabel = "Save time"
220
+ @prop timeIntervals = []
221
+ @prop columns = 2
222
+ @prop onselect
223
+ -->
@@ -0,0 +1,33 @@
1
+ import { type TimepickerProps } from "../..";
2
+ /**
3
+ * [Go to docs](https://flowbite-svelte.com/)
4
+ * ## Type
5
+ * [TimepickerProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L797)
6
+ * ## Props
7
+ * @prop id = "time"
8
+ * @prop endId = "end-time"
9
+ * @prop value = "00:00"
10
+ * @prop endValue = "00:00"
11
+ * @prop min = ""
12
+ * @prop max = ""
13
+ * @prop required = true
14
+ * @prop disabled = false
15
+ * @prop inputColor
16
+ * @prop buttonColor = "primary"
17
+ * @prop Icon
18
+ * @prop type = "default"
19
+ * @prop optionLabel = "Options"
20
+ * @prop options = []
21
+ * @prop size = "md"
22
+ * @prop divClass = "inline-flex rounded-lg shadow-sm"
23
+ * @prop inputClass
24
+ * @prop selectClass
25
+ * @prop timerangeLabel = "Choose time range"
26
+ * @prop timerangeButtonLabel = "Save time"
27
+ * @prop timeIntervals = []
28
+ * @prop columns = 2
29
+ * @prop onselect
30
+ */
31
+ declare const Timepicker: import("svelte").Component<TimepickerProps, {}, "">;
32
+ type Timepicker = ReturnType<typeof Timepicker>;
33
+ export default Timepicker;
@@ -0,0 +1,2 @@
1
+ import Timepicker from "./Timepicker.svelte";
2
+ export { Timepicker };
@@ -0,0 +1,3 @@
1
+ import Timepicker from "./Timepicker.svelte";
2
+ // import { textarea } from "./theme";
3
+ export { Timepicker };
@@ -24,7 +24,7 @@
24
24
  @component
25
25
  [Go to docs](https://flowbite-svelte.com/)
26
26
  ## Type
27
- [ToggleProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L803)
27
+ [ToggleProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L838)
28
28
  ## Props
29
29
  @prop children
30
30
  @prop size = "default"
@@ -2,7 +2,7 @@ import type { ToggleProps } from "../../types";
2
2
  /**
3
3
  * [Go to docs](https://flowbite-svelte.com/)
4
4
  * ## Type
5
- * [ToggleProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L803)
5
+ * [ToggleProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L838)
6
6
  * ## Props
7
7
  * @prop children
8
8
  * @prop size = "default"
@@ -36,7 +36,7 @@
36
36
  @component
37
37
  [Go to docs](https://flowbite-svelte.com/)
38
38
  ## Type
39
- [GalleryProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L820)
39
+ [GalleryProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L855)
40
40
  ## Props
41
41
  @prop children
42
42
  @prop figure
@@ -2,7 +2,7 @@ import type { GalleryProps } from "../types";
2
2
  /**
3
3
  * [Go to docs](https://flowbite-svelte.com/)
4
4
  * ## Type
5
- * [GalleryProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L820)
5
+ * [GalleryProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L855)
6
6
  * ## Props
7
7
  * @prop children
8
8
  * @prop figure
package/dist/index.d.ts CHANGED
@@ -32,6 +32,7 @@ export * from "./sidebar";
32
32
  export * from "./skeleton";
33
33
  export * from "./speed-dial";
34
34
  export * from "./spinner";
35
+ export * from "./steps";
35
36
  export * from "./tabs";
36
37
  export * from "./table";
37
38
  export * from "./timeline";
@@ -55,6 +56,7 @@ export * from "./forms/radio-button";
55
56
  export * from "./forms/range";
56
57
  export * from "./forms/search";
57
58
  export * from "./forms/textarea";
59
+ export * from "./forms/timepicker";
58
60
  export * from "./forms/toggle";
59
61
  export * from "./typography/anchor";
60
62
  export * from "./typography/blockquote";
package/dist/index.js CHANGED
@@ -32,6 +32,7 @@ export * from "./sidebar";
32
32
  export * from "./skeleton";
33
33
  export * from "./speed-dial";
34
34
  export * from "./spinner";
35
+ export * from "./steps";
35
36
  export * from "./tabs";
36
37
  export * from "./table";
37
38
  export * from "./timeline";
@@ -56,6 +57,7 @@ export * from "./forms/radio-button";
56
57
  export * from "./forms/range";
57
58
  export * from "./forms/search";
58
59
  export * from "./forms/textarea";
60
+ export * from "./forms/timepicker";
59
61
  export * from "./forms/toggle";
60
62
  // typography
61
63
  export * from "./typography/anchor";
@@ -29,7 +29,7 @@
29
29
  @component
30
30
  [Go to docs](https://flowbite-svelte.com/)
31
31
  ## Type
32
- [IndicatorProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L828)
32
+ [IndicatorProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L863)
33
33
  ## Props
34
34
  @prop children
35
35
  @prop color = "primary"
@@ -2,7 +2,7 @@ import type { IndicatorProps } from "../types";
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#L828)
5
+ * [IndicatorProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L863)
6
6
  * ## Props
7
7
  * @prop children
8
8
  * @prop color = "primary"
@@ -15,7 +15,7 @@
15
15
  @component
16
16
  [Go to docs](https://flowbite-svelte.com/)
17
17
  ## Type
18
- [KbdProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L839)
18
+ [KbdProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L874)
19
19
  ## Props
20
20
  @prop children
21
21
  @prop class: className
@@ -2,7 +2,7 @@ import type { KbdProps } from "../types";
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#L839)
5
+ * [KbdProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L874)
6
6
  * ## Props
7
7
  * @prop children
8
8
  * @prop class: className
@@ -33,7 +33,7 @@
33
33
  @component
34
34
  [Go to docs](https://flowbite-svelte.com/)
35
35
  ## Type
36
- [ListgroupProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L858)
36
+ [ListgroupProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L893)
37
37
  ## Props
38
38
  @prop children
39
39
  @prop items
@@ -2,7 +2,7 @@ import type { ListgroupProps } from "../types";
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#L858)
5
+ * [ListgroupProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L893)
6
6
  * ## Props
7
7
  * @prop children
8
8
  * @prop items
@@ -41,7 +41,7 @@
41
41
  @component
42
42
  [Go to docs](https://flowbite-svelte.com/)
43
43
  ## Type
44
- [ListgroupItemProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L869)
44
+ [ListgroupItemProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L904)
45
45
  ## Props
46
46
  @prop children
47
47
  @prop active
@@ -2,7 +2,7 @@ import type { ListgroupItemProps } from "../types";
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#L869)
5
+ * [ListgroupItemProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L904)
6
6
  * ## Props
7
7
  * @prop children
8
8
  * @prop active
@@ -36,7 +36,7 @@
36
36
  @component
37
37
  [Go to docs](https://flowbite-svelte.com/)
38
38
  ## Type
39
- [MegaMenuProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L879)
39
+ [MegaMenuProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L914)
40
40
  ## Props
41
41
  @prop children
42
42
  @prop extra
@@ -2,7 +2,7 @@ import type { MegaMenuProps } from "../types";
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#L879)
5
+ * [MegaMenuProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L914)
6
6
  * ## Props
7
7
  * @prop children
8
8
  * @prop extra
@@ -77,7 +77,7 @@
77
77
  @component
78
78
  [Go to docs](https://flowbite-svelte.com/)
79
79
  ## Type
80
- [ModalProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L888)
80
+ [ModalProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L923)
81
81
  ## Props
82
82
  @prop children
83
83
  @prop oncancel
@@ -2,7 +2,7 @@ import type { ModalProps } from "../types";
2
2
  /**
3
3
  * [Go to docs](https://flowbite-svelte.com/)
4
4
  * ## Type
5
- * [ModalProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L888)
5
+ * [ModalProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L923)
6
6
  * ## Props
7
7
  * @prop children
8
8
  * @prop oncancel
@@ -32,7 +32,7 @@
32
32
  @component
33
33
  [Go to docs](https://flowbite-svelte.com/)
34
34
  ## Type
35
- [MenuProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L904)
35
+ [MenuProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L939)
36
36
  ## Props
37
37
  @prop size = "24"
38
38
  @prop color = "currentColor"
@@ -2,7 +2,7 @@ import type { MenuProps } from "../types";
2
2
  /**
3
3
  * [Go to docs](https://flowbite-svelte.com/)
4
4
  * ## Type
5
- * [MenuProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L904)
5
+ * [MenuProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L939)
6
6
  * ## Props
7
7
  * @prop size = "24"
8
8
  * @prop color = "currentColor"
@@ -14,7 +14,7 @@
14
14
  @component
15
15
  [Go to docs](https://flowbite-svelte.com/)
16
16
  ## Type
17
- [NavBrandProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L923)
17
+ [NavBrandProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L958)
18
18
  ## Props
19
19
  @prop children
20
20
  @prop class: className
@@ -2,7 +2,7 @@ import type { NavBrandProps } from "../types";
2
2
  /**
3
3
  * [Go to docs](https://flowbite-svelte.com/)
4
4
  * ## Type
5
- * [NavBrandProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L923)
5
+ * [NavBrandProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L958)
6
6
  * ## Props
7
7
  * @prop children
8
8
  * @prop class: className
@@ -14,7 +14,7 @@
14
14
  @component
15
15
  [Go to docs](https://flowbite-svelte.com/)
16
16
  ## Type
17
- [NavContainerProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L925)
17
+ [NavContainerProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L960)
18
18
  ## Props
19
19
  @prop children
20
20
  @prop fluid
@@ -2,7 +2,7 @@ import type { NavContainerProps } from "../types";
2
2
  /**
3
3
  * [Go to docs](https://flowbite-svelte.com/)
4
4
  * ## Type
5
- * [NavContainerProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L925)
5
+ * [NavContainerProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L960)
6
6
  * ## Props
7
7
  * @prop children
8
8
  * @prop fluid
@@ -25,7 +25,7 @@
25
25
  @component
26
26
  [Go to docs](https://flowbite-svelte.com/)
27
27
  ## Type
28
- [NavHamburgerProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L929)
28
+ [NavHamburgerProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L964)
29
29
  ## Props
30
30
  @prop children
31
31
  @prop onclick