flowbite-svelte 0.48.3 → 0.48.5
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/README.md +8 -0
- package/dist/badge/Badge.svelte +1 -0
- package/dist/badge/Badge.svelte.d.ts +1 -0
- package/dist/datepicker/Datepicker.svelte +1 -1
- package/dist/drawer/Drawer.svelte +1 -0
- package/dist/drawer/Drawer.svelte.d.ts +1 -0
- package/dist/forms/Fileupload.svelte.d.ts +1 -0
- package/dist/forms/Input.svelte +7 -5
- package/dist/forms/Input.svelte.d.ts +2 -0
- package/dist/forms/NumberInput.svelte.d.ts +1 -0
- package/dist/forms/Search.svelte.d.ts +1 -0
- package/dist/forms/Timepicker.svelte +209 -0
- package/dist/forms/Timepicker.svelte.d.ts +76 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/navbar/NavHamburger.svelte +1 -0
- package/dist/navbar/NavHamburger.svelte.d.ts +1 -0
- package/dist/table/TableBodyRow.svelte +1 -1
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -4,6 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
**⚠️ Flowbite Svelte is currently in early development and APIs and packages are likely to change quite often.**
|
|
6
6
|
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
> [!IMPORTANT] This repo is fairly stable implementation in Svelte 4. It is however build on TailwindCss v4. The maintenance of that repo is now limited.
|
|
10
|
+
>
|
|
11
|
+
> There is early stage re-implementation of that library in Svelte 5 available at [flowbite-svelte-next](https://github.com/themesberg/flowbite-svelte-next). If you interested in trying it out, please go ahead and do give us the feedback by creating the issues in that new repo.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
7
15
|
<p>
|
|
8
16
|
<a href="https://flowbite-svelte.com" >
|
|
9
17
|
<img alt="Flowbite Svelte UI components" width="350" src="https://raw.githubusercontent.com/themesberg/flowbite-svelte/main/static/images/flowbite-svelte.png">
|
package/dist/badge/Badge.svelte
CHANGED
|
@@ -94,4 +94,5 @@ $: badgeClass = twMerge(baseClass, large ? "text-sm" : "text-xs", border ? `bord
|
|
|
94
94
|
@prop export let rounded: $$Props['rounded'] = false;
|
|
95
95
|
@prop export let transition: NonNullable<$$Props['transition']> = fade;
|
|
96
96
|
@prop export let params: $$Props['params'] = {};
|
|
97
|
+
@prop export let tag: $$Props['tag'] = 'div';
|
|
97
98
|
-->
|
|
@@ -40,6 +40,7 @@ export type BadgeSlots = typeof __propDef.slots;
|
|
|
40
40
|
* @prop export let rounded: $$Props['rounded'] = false;
|
|
41
41
|
* @prop export let transition: NonNullable<$$Props['transition']> = fade;
|
|
42
42
|
* @prop export let params: $$Props['params'] = {};
|
|
43
|
+
* @prop export let tag: $$Props['tag'] = 'div';
|
|
43
44
|
*/
|
|
44
45
|
export default class Badge extends SvelteComponentTyped<BadgeProps, BadgeEvents, BadgeSlots> {
|
|
45
46
|
}
|
|
@@ -243,7 +243,7 @@ function handleApply() {
|
|
|
243
243
|
<Button on:click={() => changeMonth(-1)} {color} size="sm" aria-label="Previous month">
|
|
244
244
|
<svg class="w-3 h-3 rtl:rotate-180 text-white dark:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 10"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 5H1m0 0 4 4M1 5l4-4"></path></svg>
|
|
245
245
|
</Button>
|
|
246
|
-
<h3 class="text-lg font-semibold dark:text-white" aria-live="polite">
|
|
246
|
+
<h3 class="text-lg font-semibold text-gray-900 dark:text-white" aria-live="polite">
|
|
247
247
|
{currentMonth.toLocaleString(locale, { month: 'long', year: 'numeric' })}
|
|
248
248
|
</h3>
|
|
249
249
|
<Button on:click={() => changeMonth(1)} {color} size="sm" aria-label="Next month">
|
|
@@ -71,6 +71,7 @@ function clickOutsideWrapper(node, callback) {
|
|
|
71
71
|
@prop export let bottomOffset: $$Props['bottomOffset'] = 'inset-x-0 bottom-0';
|
|
72
72
|
@prop export let width: $$Props['width'] = 'w-80';
|
|
73
73
|
@prop export let backdrop: $$Props['backdrop'] = true;
|
|
74
|
+
@prop export let backdropClass: $$Props['backdropClass'] = '';
|
|
74
75
|
@prop export let bgColor: $$Props['bgColor'] = 'bg-gray-900';
|
|
75
76
|
@prop export let bgOpacity: $$Props['bgOpacity'] = 'bg-black/75';
|
|
76
77
|
@prop export let placement: NonNullable<$$Props['placement']> = 'left';
|
|
@@ -45,6 +45,7 @@ export type DrawerSlots = typeof __propDef.slots;
|
|
|
45
45
|
* @prop export let bottomOffset: $$Props['bottomOffset'] = 'inset-x-0 bottom-0';
|
|
46
46
|
* @prop export let width: $$Props['width'] = 'w-80';
|
|
47
47
|
* @prop export let backdrop: $$Props['backdrop'] = true;
|
|
48
|
+
* @prop export let backdropClass: $$Props['backdropClass'] = '';
|
|
48
49
|
* @prop export let bgColor: $$Props['bgColor'] = 'bg-gray-900';
|
|
49
50
|
* @prop export let bgOpacity: $$Props['bgOpacity'] = 'bg-black/75';
|
|
50
51
|
* @prop export let placement: NonNullable<$$Props['placement']> = 'left';
|
package/dist/forms/Input.svelte
CHANGED
|
@@ -16,6 +16,7 @@ export let color = "base";
|
|
|
16
16
|
export let floatClass = "flex absolute inset-y-0 items-center text-gray-500 dark:text-gray-400";
|
|
17
17
|
export let classLeft = "";
|
|
18
18
|
export let classRight = "";
|
|
19
|
+
export let wrapperClass = "relative w-auto";
|
|
19
20
|
const dispatcher = createEventDispatcher();
|
|
20
21
|
const borderClasses = {
|
|
21
22
|
base: "border border-gray-300 dark:border-gray-600",
|
|
@@ -53,7 +54,7 @@ const clearAll = (e) => {
|
|
|
53
54
|
};
|
|
54
55
|
</script>
|
|
55
56
|
|
|
56
|
-
<Wrapper class=
|
|
57
|
+
<Wrapper class={wrapperClass} show={$$slots.left || $$slots.right || !!clearable}>
|
|
57
58
|
{#if $$slots.left}
|
|
58
59
|
<div class="{twMerge(floatClass, classLeft)} start-0 ps-2.5 pointer-events-none">
|
|
59
60
|
<slot name="left" />
|
|
@@ -63,12 +64,12 @@ const clearAll = (e) => {
|
|
|
63
64
|
<input {...$$restProps} bind:value on:blur on:change on:click on:contextmenu on:focus on:keydown on:keypress on:keyup on:mouseover on:mouseenter on:mouseleave on:paste on:input {...{ type }} class={inputClass} />
|
|
64
65
|
</slot>
|
|
65
66
|
{#if $$slots.right}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
<div class="{twMerge(floatClass, classRight)} end-0 pe-2.5">
|
|
68
|
+
<slot name="right"></slot>
|
|
69
|
+
</div>
|
|
69
70
|
{/if}
|
|
70
71
|
{#if clearable && value && `${value}`.length > 0}
|
|
71
|
-
<CloseButton {size} on:click={clearAll} color="none" class="
|
|
72
|
+
<CloseButton {size} on:click={clearAll} color="none" class="{twMerge(floatClass, classRight)} focus:ring-0 end-1" tabindex={-1} />
|
|
72
73
|
{/if}
|
|
73
74
|
</Wrapper>
|
|
74
75
|
|
|
@@ -85,4 +86,5 @@ const clearAll = (e) => {
|
|
|
85
86
|
@prop export let floatClass: $$Props['floatClass'] = 'flex absolute inset-y-0 items-center text-gray-500 dark:text-gray-400';
|
|
86
87
|
@prop export let classLeft: $$Props['classLeft'] = '';
|
|
87
88
|
@prop export let classRight: $$Props['classRight'] = '';
|
|
89
|
+
@prop export let wrapperClass: $$Props['wrapperClass'] = 'relative w-auto';
|
|
88
90
|
-->
|
|
@@ -14,6 +14,7 @@ declare const __propDef: {
|
|
|
14
14
|
floatClass?: string;
|
|
15
15
|
classLeft?: string;
|
|
16
16
|
classRight?: string;
|
|
17
|
+
wrapperClass?: string;
|
|
17
18
|
};
|
|
18
19
|
events: {
|
|
19
20
|
blur: FocusEvent;
|
|
@@ -57,6 +58,7 @@ export type InputSlots = typeof __propDef.slots;
|
|
|
57
58
|
* @prop export let floatClass: $$Props['floatClass'] = 'flex absolute inset-y-0 items-center text-gray-500 dark:text-gray-400';
|
|
58
59
|
* @prop export let classLeft: $$Props['classLeft'] = '';
|
|
59
60
|
* @prop export let classRight: $$Props['classRight'] = '';
|
|
61
|
+
* @prop export let wrapperClass: $$Props['wrapperClass'] = 'relative w-auto';
|
|
60
62
|
*/
|
|
61
63
|
export default class Input extends SvelteComponentTyped<InputProps, InputEvents, InputSlots> {
|
|
62
64
|
}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
<script>import { createEventDispatcher } from "svelte";
|
|
2
|
+
import { Dropdown, DropdownItem, Button, Input, ButtonGroup, Select, InputAddon, Label, Toggle } from "..";
|
|
3
|
+
export let id = "time";
|
|
4
|
+
export let endId = "end-time";
|
|
5
|
+
export let value = "00:00";
|
|
6
|
+
export let endValue = "00:00";
|
|
7
|
+
export let min = "";
|
|
8
|
+
export let max = "";
|
|
9
|
+
export let required = true;
|
|
10
|
+
export let disabled = false;
|
|
11
|
+
export let color = "base";
|
|
12
|
+
export let buttonColor = "primary";
|
|
13
|
+
export let icon;
|
|
14
|
+
export let type = "default";
|
|
15
|
+
export let optionLabel = "Options";
|
|
16
|
+
export let options = [];
|
|
17
|
+
export let selectedOption = "";
|
|
18
|
+
export let size = "md";
|
|
19
|
+
export let divClass = "inline-flex rounded-lg shadow-sm";
|
|
20
|
+
export let inputClass = "block disabled:cursor-not-allowed disabled:opacity-50 rtl:text-right focus:ring-0 focus:outline-none p-2.5 border-r-0";
|
|
21
|
+
export let selectClass = "text-gray-900 disabled:text-gray-400 bg-gray-50 border border-gray-300 rounded-r-lg 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";
|
|
22
|
+
export let timerangeLabel = "Choose time range";
|
|
23
|
+
export let timerangeButtonLabel = "Save time";
|
|
24
|
+
export let timeIntervals = [];
|
|
25
|
+
export let columns = 2;
|
|
26
|
+
let dropdownOpen = false;
|
|
27
|
+
let showTimerange = false;
|
|
28
|
+
const dispatch = createEventDispatcher();
|
|
29
|
+
function timeToMinutes(time) {
|
|
30
|
+
const [hours, minutes] = time.split(":").map(Number);
|
|
31
|
+
return hours * 60 + minutes;
|
|
32
|
+
}
|
|
33
|
+
function handleTimeChange(event, isEndTime = false) {
|
|
34
|
+
const newValue = event.target.value;
|
|
35
|
+
const newMinutes = timeToMinutes(newValue);
|
|
36
|
+
const valueMinutes = timeToMinutes(value);
|
|
37
|
+
const endValueMinutes = timeToMinutes(endValue);
|
|
38
|
+
if (isEndTime) {
|
|
39
|
+
[value, endValue] = newMinutes < valueMinutes ? [newValue, value] : [value, newValue];
|
|
40
|
+
} else {
|
|
41
|
+
[value, endValue] = newMinutes > endValueMinutes ? [endValue, newValue] : [newValue, endValue];
|
|
42
|
+
}
|
|
43
|
+
if (type !== "timerange-dropdown") {
|
|
44
|
+
dispatchChange();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function handleOptionSelect(event) {
|
|
48
|
+
selectedOption = event.target.value;
|
|
49
|
+
dispatchChange();
|
|
50
|
+
}
|
|
51
|
+
function handleDropdownSelect(option) {
|
|
52
|
+
dropdownOpen = false;
|
|
53
|
+
selectedOption = option.value;
|
|
54
|
+
dispatchChange();
|
|
55
|
+
}
|
|
56
|
+
function dispatchChange() {
|
|
57
|
+
dispatch("select", {
|
|
58
|
+
time: value,
|
|
59
|
+
endTime: endValue,
|
|
60
|
+
[optionLabel ? optionLabel.toLowerCase() : "options"]: selectedOption || options[0]?.value || ""
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function applyTimerange() {
|
|
64
|
+
dropdownOpen = false;
|
|
65
|
+
dispatchChange();
|
|
66
|
+
}
|
|
67
|
+
function toggleTimerange() {
|
|
68
|
+
showTimerange = !showTimerange;
|
|
69
|
+
if (!showTimerange) {
|
|
70
|
+
dispatchChange();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function handleInlineButtonSelect(time) {
|
|
74
|
+
value = time;
|
|
75
|
+
dispatchChange();
|
|
76
|
+
}
|
|
77
|
+
</script>
|
|
78
|
+
|
|
79
|
+
{#if type !== 'inline-buttons'}
|
|
80
|
+
<ButtonGroup {size} {divClass}>
|
|
81
|
+
{#if type === 'default'}
|
|
82
|
+
<Input {id} {color} type="time" {min} {max} {required} {disabled} defaultClass="{inputClass} rounded-l-lg" bind:value on:change={(e) => handleTimeChange(e)} />
|
|
83
|
+
<InputAddon class="rounded-r-lg">
|
|
84
|
+
{#if icon}
|
|
85
|
+
<svelte:component this={icon} class="w-4 h-4 text-gray-500 dark:text-gray-400" />
|
|
86
|
+
{:else}
|
|
87
|
+
<svg class="w-4 h-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">
|
|
88
|
+
<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" />
|
|
89
|
+
</svg>
|
|
90
|
+
{/if}
|
|
91
|
+
</InputAddon>
|
|
92
|
+
{:else if type === 'select'}
|
|
93
|
+
<Input {id} {color} type="time" {min} {max} {required} {disabled} defaultClass="{inputClass} rounded-l-lg" bind:value on:change={(e) => handleTimeChange(e)} />
|
|
94
|
+
<Select defaultClass={selectClass} on:change={handleOptionSelect} items={options} value={selectedOption} />
|
|
95
|
+
{:else if type === 'dropdown'}
|
|
96
|
+
<Input {id} {color} type="time" {min} {max} {required} {disabled} defaultClass="{inputClass} rounded-l-lg" bind:value on:change={(e) => handleTimeChange(e)} />
|
|
97
|
+
<Button color={buttonColor} class="rounded-r-lg">
|
|
98
|
+
{optionLabel}
|
|
99
|
+
<svg class="w-4 h-4 ml-2" 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>
|
|
100
|
+
</Button>
|
|
101
|
+
<Dropdown bind:open={dropdownOpen}>
|
|
102
|
+
{#each options as option}
|
|
103
|
+
<DropdownItem on:click={() => handleDropdownSelect(option)}>
|
|
104
|
+
{option.name}
|
|
105
|
+
</DropdownItem>
|
|
106
|
+
{/each}
|
|
107
|
+
</Dropdown>
|
|
108
|
+
{:else if type === 'range'}
|
|
109
|
+
<Input {id} {color} type="time" {min} {max} {required} {disabled} defaultClass="{inputClass} rounded-l-lg" bind:value on:change={(e) => handleTimeChange(e)} />
|
|
110
|
+
<InputAddon class="rounded-none">
|
|
111
|
+
{#if icon}
|
|
112
|
+
<svelte:component this={icon} class="w-4 h-4 text-gray-500 dark:text-gray-400" />
|
|
113
|
+
{:else}
|
|
114
|
+
<svg class="w-4 h-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">
|
|
115
|
+
<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" />
|
|
116
|
+
</svg>
|
|
117
|
+
{/if}
|
|
118
|
+
</InputAddon>
|
|
119
|
+
<span class="flex items-center justify-center text-gray-500 dark:text-gray-400 px-2">-</span>
|
|
120
|
+
<Input id={endId} {color} type="time" {min} {max} {required} {disabled} defaultClass="{inputClass} rounded-none" bind:value={endValue} on:change={(e) => handleTimeChange(e, true)} />
|
|
121
|
+
<InputAddon class="rounded-r-lg">
|
|
122
|
+
{#if icon}
|
|
123
|
+
<svelte:component this={icon} class="w-4 h-4 text-gray-500 dark:text-gray-400" />
|
|
124
|
+
{:else}
|
|
125
|
+
<svg class="w-4 h-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">
|
|
126
|
+
<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" />
|
|
127
|
+
</svg>
|
|
128
|
+
{/if}
|
|
129
|
+
</InputAddon>
|
|
130
|
+
{:else if type === 'timerange-dropdown'}
|
|
131
|
+
<Button color={buttonColor} {size} class="rounded-r-lg">
|
|
132
|
+
{timerangeLabel}
|
|
133
|
+
<svg class="w-4 h-4 ml-2" 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>
|
|
134
|
+
</Button>
|
|
135
|
+
<Dropdown bind:open={dropdownOpen} classContainer="p-4 w-auto last:rounded-r-lg">
|
|
136
|
+
<div class="flex flex-col space-y-4">
|
|
137
|
+
<div class="flex space-x-4">
|
|
138
|
+
<div class="flex flex-col">
|
|
139
|
+
<Label for={id}>Start time:</Label>
|
|
140
|
+
<Input {id} {color} type="time" {min} {max} {required} {disabled} defaultClass="{inputClass} rounded-l-lg" bind:value on:change={(e) => handleTimeChange(e)} />
|
|
141
|
+
</div>
|
|
142
|
+
<div class="flex flex-col">
|
|
143
|
+
<Label for={endId}>End time:</Label>
|
|
144
|
+
<Input id={endId} {color} type="time" {min} {max} {required} {disabled} defaultClass="{inputClass} rounded-l-lg" bind:value={endValue} on:change={(e) => handleTimeChange(e, true)} />
|
|
145
|
+
</div>
|
|
146
|
+
</div>
|
|
147
|
+
<Button color={buttonColor} class="w-full rounded-l-lg" on:click={applyTimerange}>
|
|
148
|
+
{timerangeButtonLabel}
|
|
149
|
+
</Button>
|
|
150
|
+
</div>
|
|
151
|
+
</Dropdown>
|
|
152
|
+
{:else if type === 'timerange-toggle'}
|
|
153
|
+
<div class="flex flex-col space-y-2 w-full">
|
|
154
|
+
<div class="flex items-center justify-between">
|
|
155
|
+
<Toggle id={`${id}-timerange-toggle`} checked={showTimerange} on:change={toggleTimerange} />
|
|
156
|
+
</div>
|
|
157
|
+
{#if showTimerange}
|
|
158
|
+
<div class="flex space-x-4">
|
|
159
|
+
<div class="flex flex-col">
|
|
160
|
+
<Label for={id}>Start time:</Label>
|
|
161
|
+
<Input {id} {color} type="time" {min} {max} {required} {disabled} defaultClass="{inputClass} rounded-lg" bind:value on:change={(e) => handleTimeChange(e)} />
|
|
162
|
+
</div>
|
|
163
|
+
<div class="flex flex-col">
|
|
164
|
+
<Label for={endId}>End time:</Label>
|
|
165
|
+
<Input id={endId} {color} type="time" {min} {max} {required} {disabled} defaultClass="{inputClass} rounded-lg" bind:value={endValue} on:change={(e) => handleTimeChange(e, true)} />
|
|
166
|
+
</div>
|
|
167
|
+
</div>
|
|
168
|
+
{/if}
|
|
169
|
+
</div>
|
|
170
|
+
{/if}
|
|
171
|
+
</ButtonGroup>
|
|
172
|
+
{:else}
|
|
173
|
+
<div class="grid gap-2 w-full" class:grid-cols-1={columns === 1} class:grid-cols-2={columns === 2} class:grid-cols-3={columns === 3} class:grid-cols-4={columns === 4}>
|
|
174
|
+
{#each timeIntervals as time}
|
|
175
|
+
<Button {size} color={value === time ? buttonColor : 'light'} class="rounded-lg" on:click={() => handleInlineButtonSelect(time)}>
|
|
176
|
+
{time}
|
|
177
|
+
</Button>
|
|
178
|
+
{/each}
|
|
179
|
+
</div>
|
|
180
|
+
{/if}
|
|
181
|
+
|
|
182
|
+
<!--
|
|
183
|
+
@component
|
|
184
|
+
[Go to docs](https://flowbite-svelte.com/)
|
|
185
|
+
## Props
|
|
186
|
+
@prop export let id = 'time';
|
|
187
|
+
@prop export let endId = 'end-time';
|
|
188
|
+
@prop export let value = '00:00';
|
|
189
|
+
@prop export let endValue = '00:00';
|
|
190
|
+
@prop export let min = '';
|
|
191
|
+
@prop export let max = '';
|
|
192
|
+
@prop export let required = true;
|
|
193
|
+
@prop export let disabled = false;
|
|
194
|
+
@prop export let color: 'base' | 'red' | 'green' | undefined = 'base';
|
|
195
|
+
@prop export let buttonColor: ButtonColorType = 'primary';
|
|
196
|
+
@prop export let icon: ComponentType;
|
|
197
|
+
@prop export let type: 'default' | 'dropdown' | 'select' | 'range' | 'timerange-dropdown' | 'timerange-toggle' | 'inline-buttons' = 'default';
|
|
198
|
+
@prop export let optionLabel = 'Options';
|
|
199
|
+
@prop export let options: { value: string;
|
|
200
|
+
@prop export let selectedOption = '';
|
|
201
|
+
@prop export let size: 'sm' | 'md' | 'lg' = 'md';
|
|
202
|
+
@prop export let divClass = 'inline-flex rounded-lg shadow-sm';
|
|
203
|
+
@prop export let inputClass = 'block disabled:cursor-not-allowed disabled:opacity-50 rtl:text-right focus:ring-0 focus:outline-none p-2.5 border-r-0';
|
|
204
|
+
@prop export let selectClass = 'text-gray-900 disabled:text-gray-400 bg-gray-50 border border-gray-300 rounded-r-lg 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';
|
|
205
|
+
@prop export let timerangeLabel = 'Choose time range';
|
|
206
|
+
@prop export let timerangeButtonLabel = 'Save time';
|
|
207
|
+
@prop export let timeIntervals: string[] = [];
|
|
208
|
+
@prop export let columns: 1 | 2 | 3 | 4 = 2;
|
|
209
|
+
-->
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { ButtonColorType } from '../types';
|
|
3
|
+
import type { ComponentType } from 'svelte';
|
|
4
|
+
declare const __propDef: {
|
|
5
|
+
props: {
|
|
6
|
+
id?: string;
|
|
7
|
+
endId?: string;
|
|
8
|
+
value?: string;
|
|
9
|
+
endValue?: string;
|
|
10
|
+
min?: string;
|
|
11
|
+
max?: string;
|
|
12
|
+
required?: boolean;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
color?: "base" | "red" | "green" | undefined;
|
|
15
|
+
buttonColor?: ButtonColorType;
|
|
16
|
+
icon: ComponentType;
|
|
17
|
+
type?: "default" | "dropdown" | "select" | "range" | "timerange-dropdown" | "timerange-toggle" | "inline-buttons";
|
|
18
|
+
optionLabel?: string;
|
|
19
|
+
options?: {
|
|
20
|
+
value: string;
|
|
21
|
+
name: string;
|
|
22
|
+
}[];
|
|
23
|
+
selectedOption?: string;
|
|
24
|
+
size?: "sm" | "md" | "lg";
|
|
25
|
+
divClass?: string;
|
|
26
|
+
inputClass?: string;
|
|
27
|
+
selectClass?: string;
|
|
28
|
+
timerangeLabel?: string;
|
|
29
|
+
timerangeButtonLabel?: string;
|
|
30
|
+
timeIntervals?: string[];
|
|
31
|
+
columns?: 1 | 2 | 3 | 4;
|
|
32
|
+
};
|
|
33
|
+
events: {
|
|
34
|
+
select: CustomEvent<{
|
|
35
|
+
[key: string]: string;
|
|
36
|
+
time: string;
|
|
37
|
+
endTime?: string;
|
|
38
|
+
}>;
|
|
39
|
+
} & {
|
|
40
|
+
[evt: string]: CustomEvent<any>;
|
|
41
|
+
};
|
|
42
|
+
slots: {};
|
|
43
|
+
};
|
|
44
|
+
export type TimepickerProps = typeof __propDef.props;
|
|
45
|
+
export type TimepickerEvents = typeof __propDef.events;
|
|
46
|
+
export type TimepickerSlots = typeof __propDef.slots;
|
|
47
|
+
/**
|
|
48
|
+
* [Go to docs](https://flowbite-svelte.com/)
|
|
49
|
+
* ## Props
|
|
50
|
+
* @prop export let id = 'time';
|
|
51
|
+
* @prop export let endId = 'end-time';
|
|
52
|
+
* @prop export let value = '00:00';
|
|
53
|
+
* @prop export let endValue = '00:00';
|
|
54
|
+
* @prop export let min = '';
|
|
55
|
+
* @prop export let max = '';
|
|
56
|
+
* @prop export let required = true;
|
|
57
|
+
* @prop export let disabled = false;
|
|
58
|
+
* @prop export let color: 'base' | 'red' | 'green' | undefined = 'base';
|
|
59
|
+
* @prop export let buttonColor: ButtonColorType = 'primary';
|
|
60
|
+
* @prop export let icon: ComponentType;
|
|
61
|
+
* @prop export let type: 'default' | 'dropdown' | 'select' | 'range' | 'timerange-dropdown' | 'timerange-toggle' | 'inline-buttons' = 'default';
|
|
62
|
+
* @prop export let optionLabel = 'Options';
|
|
63
|
+
* @prop export let options: { value: string;
|
|
64
|
+
* @prop export let selectedOption = '';
|
|
65
|
+
* @prop export let size: 'sm' | 'md' | 'lg' = 'md';
|
|
66
|
+
* @prop export let divClass = 'inline-flex rounded-lg shadow-sm';
|
|
67
|
+
* @prop export let inputClass = 'block disabled:cursor-not-allowed disabled:opacity-50 rtl:text-right focus:ring-0 focus:outline-none p-2.5 border-r-0';
|
|
68
|
+
* @prop export let selectClass = 'text-gray-900 disabled:text-gray-400 bg-gray-50 border border-gray-300 rounded-r-lg 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';
|
|
69
|
+
* @prop export let timerangeLabel = 'Choose time range';
|
|
70
|
+
* @prop export let timerangeButtonLabel = 'Save time';
|
|
71
|
+
* @prop export let timeIntervals: string[] = [];
|
|
72
|
+
* @prop export let columns: 1 | 2 | 3 | 4 = 2;
|
|
73
|
+
*/
|
|
74
|
+
export default class Timepicker extends SvelteComponentTyped<TimepickerProps, TimepickerEvents, TimepickerSlots> {
|
|
75
|
+
}
|
|
76
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -48,6 +48,7 @@ export { default as Range } from "./forms/Range.svelte";
|
|
|
48
48
|
export { default as Search } from "./forms/Search.svelte";
|
|
49
49
|
export { default as Select } from "./forms/Select.svelte";
|
|
50
50
|
export { default as Textarea } from "./forms/Textarea.svelte";
|
|
51
|
+
export { default as Timepicker } from "./forms/Timepicker.svelte";
|
|
51
52
|
export { default as Toggle } from "./forms/Toggle.svelte";
|
|
52
53
|
export { default as Gallery } from "./gallery/Gallery.svelte";
|
|
53
54
|
export { default as Indicator } from "./indicators/Indicator.svelte";
|
package/dist/index.js
CHANGED
|
@@ -85,6 +85,7 @@ export { default as Range } from './forms/Range.svelte';
|
|
|
85
85
|
export { default as Search } from './forms/Search.svelte';
|
|
86
86
|
export { default as Select } from './forms/Select.svelte';
|
|
87
87
|
export { default as Textarea } from './forms/Textarea.svelte';
|
|
88
|
+
export { default as Timepicker } from './forms/Timepicker.svelte';
|
|
88
89
|
export { default as Toggle } from './forms/Toggle.svelte';
|
|
89
90
|
|
|
90
91
|
// Gallery
|
|
@@ -23,4 +23,5 @@ const toggle = (ev) => hiddenStore.update((h) => !h);
|
|
|
23
23
|
@prop export let menuClass: $$Props['menuClass'] = 'h-6 w-6 shrink-0';
|
|
24
24
|
@prop export let onClick: $$Props['onClick'] = undefined;
|
|
25
25
|
@prop export let classMenu: $$Props['classMenu'] = '';
|
|
26
|
+
@prop export let title: $$Props['title'] = 'Open main menu';
|
|
26
27
|
-->
|
|
@@ -32,6 +32,7 @@ export type NavHamburgerSlots = typeof __propDef.slots;
|
|
|
32
32
|
* @prop export let menuClass: $$Props['menuClass'] = 'h-6 w-6 shrink-0';
|
|
33
33
|
* @prop export let onClick: $$Props['onClick'] = undefined;
|
|
34
34
|
* @prop export let classMenu: $$Props['classMenu'] = '';
|
|
35
|
+
* @prop export let title: $$Props['title'] = 'Open main menu';
|
|
35
36
|
*/
|
|
36
37
|
export default class NavHamburger extends SvelteComponentTyped<NavHamburgerProps, NavHamburgerEvents, NavHamburgerSlots> {
|
|
37
38
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { getContext } from "svelte";
|
|
3
3
|
export let color = getContext("color");
|
|
4
4
|
const colors = {
|
|
5
|
-
default: "bg-white dark:bg-gray-800 dark:border-gray-700",
|
|
5
|
+
default: "bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700",
|
|
6
6
|
blue: "bg-blue-500 border-blue-400",
|
|
7
7
|
green: "bg-green-500 border-green-400",
|
|
8
8
|
red: "bg-red-500 border-red-400",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flowbite-svelte",
|
|
3
|
-
"version": "0.48.
|
|
3
|
+
"version": "0.48.5",
|
|
4
4
|
"description": "Flowbite components for Svelte",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"packageManager": "pnpm@8.15.4",
|
|
@@ -364,6 +364,10 @@
|
|
|
364
364
|
"types": "./dist/forms/Textarea.svelte.d.ts",
|
|
365
365
|
"svelte": "./dist/forms/Textarea.svelte"
|
|
366
366
|
},
|
|
367
|
+
"./Timepicker.svelte": {
|
|
368
|
+
"types": "./dist/forms/Timepicker.svelte.d.ts",
|
|
369
|
+
"svelte": "./dist/forms/Timepicker.svelte"
|
|
370
|
+
},
|
|
367
371
|
"./Toggle.svelte": {
|
|
368
372
|
"types": "./dist/forms/Toggle.svelte.d.ts",
|
|
369
373
|
"svelte": "./dist/forms/Toggle.svelte"
|