daisy-ui-kit 5.0.3 → 5.0.4
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 +1 -1
- package/dist/index.css +1 -0
- package/dist/index.d.ts +4652 -0
- package/dist/index.js +5279 -0
- package/package.json +11 -21
- package/app/components/Accordion.vue +0 -29
- package/app/components/Alert.vue +0 -36
- package/app/components/Avatar.vue +0 -131
- package/app/components/AvatarGroup.vue +0 -22
- package/app/components/Badge.vue +0 -72
- package/app/components/Breadcrumbs.vue +0 -7
- package/app/components/Button.vue +0 -140
- package/app/components/Calendar.vue +0 -175
- package/app/components/CalendarInput.vue +0 -275
- package/app/components/CalendarSkeleton.vue +0 -87
- package/app/components/Card.vue +0 -51
- package/app/components/CardActions.vue +0 -13
- package/app/components/CardBody.vue +0 -13
- package/app/components/CardTitle.vue +0 -11
- package/app/components/Carousel.vue +0 -24
- package/app/components/CarouselItem.vue +0 -5
- package/app/components/Chat.vue +0 -26
- package/app/components/ChatBubble.vue +0 -31
- package/app/components/ChatFooter.vue +0 -5
- package/app/components/ChatHeader.vue +0 -5
- package/app/components/ChatImage.vue +0 -5
- package/app/components/Checkbox.vue +0 -51
- package/app/components/Collapse.vue +0 -76
- package/app/components/CollapseContent.vue +0 -5
- package/app/components/CollapseTitle.vue +0 -15
- package/app/components/Countdown.vue +0 -15
- package/app/components/CountdownTimers.vue +0 -69
- package/app/components/Counter.vue +0 -21
- package/app/components/Crumb.vue +0 -5
- package/app/components/DaisyLink.vue +0 -56
- package/app/components/Diff.vue +0 -11
- package/app/components/Divider.vue +0 -43
- package/app/components/Dock.vue +0 -57
- package/app/components/DockItem.vue +0 -27
- package/app/components/DockLabel.vue +0 -5
- package/app/components/Drawer.vue +0 -50
- package/app/components/DrawerContent.vue +0 -20
- package/app/components/DrawerSide.vue +0 -21
- package/app/components/Dropdown.vue +0 -106
- package/app/components/DropdownButton.vue +0 -23
- package/app/components/DropdownContent.vue +0 -127
- package/app/components/DropdownTarget.vue +0 -21
- package/app/components/Fab.vue +0 -16
- package/app/components/FabClose.vue +0 -18
- package/app/components/FabMainAction.vue +0 -5
- package/app/components/FabTrigger.vue +0 -117
- package/app/components/Fieldset.vue +0 -20
- package/app/components/FileInput.vue +0 -53
- package/app/components/Filter.vue +0 -129
- package/app/components/Flex.vue +0 -89
- package/app/components/FlexItem.vue +0 -62
- package/app/components/Footer.vue +0 -31
- package/app/components/FooterTitle.vue +0 -18
- package/app/components/FormControl.vue +0 -5
- package/app/components/Hero.vue +0 -18
- package/app/components/HeroContent.vue +0 -18
- package/app/components/HeroOverlay.vue +0 -5
- package/app/components/Hover3D.vue +0 -22
- package/app/components/HoverGallery.vue +0 -11
- package/app/components/Indicator.vue +0 -20
- package/app/components/IndicatorItem.vue +0 -43
- package/app/components/Input.vue +0 -116
- package/app/components/Join.vue +0 -5
- package/app/components/Kbd.vue +0 -25
- package/app/components/Label.vue +0 -100
- package/app/components/List.vue +0 -5
- package/app/components/ListColGrow.vue +0 -5
- package/app/components/ListColWrap.vue +0 -5
- package/app/components/ListRow.vue +0 -5
- package/app/components/LoadingBall.vue +0 -42
- package/app/components/LoadingBars.vue +0 -42
- package/app/components/LoadingDots.vue +0 -42
- package/app/components/LoadingInfinity.vue +0 -42
- package/app/components/LoadingRing.vue +0 -42
- package/app/components/LoadingSpinner.vue +0 -42
- package/app/components/Mask.vue +0 -49
- package/app/components/Menu.vue +0 -30
- package/app/components/MenuExpand.vue +0 -92
- package/app/components/MenuExpandToggle.vue +0 -20
- package/app/components/MenuItem.vue +0 -39
- package/app/components/MenuTitle.vue +0 -5
- package/app/components/MockupBrowser.vue +0 -5
- package/app/components/MockupBrowserToolbar.vue +0 -5
- package/app/components/MockupCode.vue +0 -4
- package/app/components/MockupPhone.vue +0 -14
- package/app/components/MockupWindow.vue +0 -5
- package/app/components/Modal.vue +0 -63
- package/app/components/ModalAction.vue +0 -5
- package/app/components/ModalBox.vue +0 -5
- package/app/components/NavButton.vue +0 -12
- package/app/components/Navbar.vue +0 -12
- package/app/components/NavbarCenter.vue +0 -11
- package/app/components/NavbarEnd.vue +0 -11
- package/app/components/NavbarStart.vue +0 -11
- package/app/components/Progress.vue +0 -46
- package/app/components/Prose.vue +0 -37
- package/app/components/RadialProgress.vue +0 -36
- package/app/components/Radio.vue +0 -69
- package/app/components/RadioGroup.vue +0 -47
- package/app/components/Range.vue +0 -201
- package/app/components/RangeMeasure.vue +0 -87
- package/app/components/RangeMeasureTick.vue +0 -69
- package/app/components/Rating.vue +0 -197
- package/app/components/Select.vue +0 -101
- package/app/components/Skeleton.vue +0 -5
- package/app/components/SkeletonText.vue +0 -11
- package/app/components/Stack.vue +0 -30
- package/app/components/Stat.vue +0 -19
- package/app/components/StatActions.vue +0 -5
- package/app/components/StatDesc.vue +0 -5
- package/app/components/StatFigure.vue +0 -5
- package/app/components/StatTitle.vue +0 -5
- package/app/components/StatValue.vue +0 -5
- package/app/components/Stats.vue +0 -5
- package/app/components/Status.vue +0 -43
- package/app/components/Step.vue +0 -34
- package/app/components/StepIcon.vue +0 -5
- package/app/components/Steps.vue +0 -23
- package/app/components/Swap.vue +0 -56
- package/app/components/Tab.vue +0 -56
- package/app/components/TabContent.vue +0 -29
- package/app/components/Table.vue +0 -32
- package/app/components/Tabs.vue +0 -53
- package/app/components/Text.vue +0 -166
- package/app/components/TextArea.vue +0 -106
- package/app/components/TextRotate.vue +0 -24
- package/app/components/ThemeController.vue +0 -45
- package/app/components/ThemeProvider.vue +0 -302
- package/app/components/ThemeTile.vue +0 -50
- package/app/components/Timeline.vue +0 -22
- package/app/components/TimelineEnd.vue +0 -14
- package/app/components/TimelineItem.vue +0 -5
- package/app/components/TimelineLine.vue +0 -29
- package/app/components/TimelineMiddle.vue +0 -5
- package/app/components/TimelineStart.vue +0 -14
- package/app/components/Toast.vue +0 -67
- package/app/components/Toggle.vue +0 -60
- package/app/components/Tooltip.vue +0 -137
- package/app/components/TooltipContent.vue +0 -283
- package/app/components/TooltipTarget.vue +0 -20
- package/app/components/ValidatorHint.vue +0 -5
- package/app/composables/__tests__/use-calendar.test.ts +0 -239
- package/app/composables/use-calendar.ts +0 -288
- package/app/composables/use-daisy-theme.ts +0 -140
- package/app/composables/use-toast.ts +0 -345
- package/app/composables/useSearch.ts +0 -22
- package/app/utils/drawer-utils.ts +0 -34
- package/app/utils/position-area.ts +0 -40
- package/components.d.ts +0 -145
- package/components.js +0 -141
- package/index.d.ts +0 -157
- package/index.js +0 -145
|
@@ -1,345 +0,0 @@
|
|
|
1
|
-
import type { Ref } from 'vue'
|
|
2
|
-
import { computed, reactive, ref, toRef } from 'vue'
|
|
3
|
-
|
|
4
|
-
export type ToastType = 'success' | 'error' | 'info' | 'warning' | string
|
|
5
|
-
|
|
6
|
-
export type ToastPosition =
|
|
7
|
-
| 'top-start'
|
|
8
|
-
| 'top-center'
|
|
9
|
-
| 'top-end'
|
|
10
|
-
| 'middle-start'
|
|
11
|
-
| 'middle-center'
|
|
12
|
-
| 'middle-end'
|
|
13
|
-
| 'bottom-start'
|
|
14
|
-
| 'bottom-center'
|
|
15
|
-
| 'bottom-end'
|
|
16
|
-
|
|
17
|
-
export type ToastStatus = 'pending' | 'success' | 'error' | 'info' | 'warning' | 'default'
|
|
18
|
-
|
|
19
|
-
export interface Toast {
|
|
20
|
-
id: number
|
|
21
|
-
message: string
|
|
22
|
-
name?: string // toast channel name, optional but always set by logic
|
|
23
|
-
type?: ToastType
|
|
24
|
-
duration?: number
|
|
25
|
-
position: ToastPosition
|
|
26
|
-
countdown?: number
|
|
27
|
-
status?: ToastStatus
|
|
28
|
-
progress?: number // 0-1 for progress bar
|
|
29
|
-
promiseId?: string // for async/promise support
|
|
30
|
-
ariaLive?: 'polite' | 'assertive' // accessibility
|
|
31
|
-
[key: string]: any
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* State for a single toast channel (internal use)
|
|
36
|
-
*/
|
|
37
|
-
export interface ToastChannelState {
|
|
38
|
-
toasts: Ref<Toast[]>
|
|
39
|
-
toastQueue: Toast[]
|
|
40
|
-
toastLimit: number | null
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
let globalToastChannels: Ref<Record<string, ToastChannelState & { defaults?: Partial<Toast> }>> | null = null
|
|
44
|
-
let globalNextToastId: Ref<number> | null = null
|
|
45
|
-
|
|
46
|
-
function getGlobalToastChannels() {
|
|
47
|
-
if (!globalToastChannels) {
|
|
48
|
-
globalToastChannels = ref({})
|
|
49
|
-
}
|
|
50
|
-
return globalToastChannels
|
|
51
|
-
}
|
|
52
|
-
function getGlobalNextToastId() {
|
|
53
|
-
if (!globalNextToastId) {
|
|
54
|
-
globalNextToastId = ref(1)
|
|
55
|
-
}
|
|
56
|
-
return globalNextToastId
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function getOrCreateChannel(name: string, defaults?: Partial<Toast>, limit?: number | null) {
|
|
60
|
-
const channels = getGlobalToastChannels().value
|
|
61
|
-
if (!channels[name]) {
|
|
62
|
-
channels[name] = {
|
|
63
|
-
toasts: ref<Toast[]>([]),
|
|
64
|
-
toastQueue: [],
|
|
65
|
-
toastLimit: typeof limit === 'number' ? limit : null,
|
|
66
|
-
defaults,
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
return toRef(channels[name])
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Clear all toast queues for all channels (useful for logout or channel switch)
|
|
74
|
-
*/
|
|
75
|
-
export function clearAllToastQueues() {
|
|
76
|
-
const channels = getGlobalToastChannels().value
|
|
77
|
-
Object.values(channels).forEach(channel => {
|
|
78
|
-
channel.toastQueue.length = 0
|
|
79
|
-
})
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Global toast notification composable supporting named channels.
|
|
84
|
-
*
|
|
85
|
-
* - Each toast has an optional `name` property (defaults to 'default').
|
|
86
|
-
* - All toast state (toasts, queue, limit) is isolated per channel.
|
|
87
|
-
* - UI and logic can independently manage/display different channels.
|
|
88
|
-
* - Defensive dev warnings if name is missing/invalid.
|
|
89
|
-
*
|
|
90
|
-
* Example usage:
|
|
91
|
-
* const { toasts, addToast } = useToast({ name: 'admin' })
|
|
92
|
-
* addToast({ message: 'Hi', name: 'admin' })
|
|
93
|
-
* // In UI: <Toast name="admin" />
|
|
94
|
-
*/
|
|
95
|
-
/**
|
|
96
|
-
* Options for useToast composable.
|
|
97
|
-
* - name: channel name (default: 'default')
|
|
98
|
-
* - defaults: default toast settings for this channel (merged into each toast)
|
|
99
|
-
*/
|
|
100
|
-
export interface UseToastOptions {
|
|
101
|
-
name?: string
|
|
102
|
-
defaults?: Partial<Toast>
|
|
103
|
-
limit?: number // per-channel toast limit
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Global toast notification composable supporting named channels and customizable defaults.
|
|
108
|
-
*
|
|
109
|
-
* - Each toast has an optional `name` property (defaults to 'default').
|
|
110
|
-
* - All toast state (toasts, queue, limit) is isolated per channel.
|
|
111
|
-
* - UI and logic can independently manage/display different channels.
|
|
112
|
-
* - Defensive dev warnings if name is missing/invalid.
|
|
113
|
-
* - You can provide `defaults` to set default toast settings for all toasts in this channel.
|
|
114
|
-
*
|
|
115
|
-
* Example usage:
|
|
116
|
-
* const { toasts, addToast } = useToast({ name: 'admin', defaults: { duration: 6000, type: 'info' } })
|
|
117
|
-
* addToast({ message: 'Hi' }) // will use defaults
|
|
118
|
-
* // In UI: <Toast name="admin" />
|
|
119
|
-
*/
|
|
120
|
-
function normalizeToast(toast: any): Toast & { countdown: number; originalDuration: number; intervalId?: number } {
|
|
121
|
-
if (toast.originalDuration == null) {
|
|
122
|
-
toast.originalDuration = toast.duration ?? 0
|
|
123
|
-
}
|
|
124
|
-
if (toast.countdown == null) {
|
|
125
|
-
toast.countdown = toast.originalDuration
|
|
126
|
-
}
|
|
127
|
-
if (typeof toast.intervalId === 'undefined') {
|
|
128
|
-
toast.intervalId = undefined
|
|
129
|
-
}
|
|
130
|
-
return toast as Toast & { countdown: number; originalDuration: number; intervalId?: number }
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
export function useToast(options?: UseToastOptions) {
|
|
134
|
-
const name = options?.name?.trim() || 'default'
|
|
135
|
-
const defaults = options?.defaults || {}
|
|
136
|
-
const limit = typeof options?.limit === 'number' ? options.limit : null
|
|
137
|
-
|
|
138
|
-
// Always get or create the channel (init only once)
|
|
139
|
-
const channel = getOrCreateChannel(name, defaults, limit)
|
|
140
|
-
|
|
141
|
-
function addToast(
|
|
142
|
-
toast: { message: string; position?: ToastPosition; name?: string } & Partial<Omit<Toast, 'id' | 'name'>>,
|
|
143
|
-
) {
|
|
144
|
-
const toastName = toast.name?.trim() || name
|
|
145
|
-
const nextToastIdRef = getGlobalNextToastId()
|
|
146
|
-
// Always get or create the target channel for this toast, using the correct limit if provided
|
|
147
|
-
const channelLimit = typeof options?.limit === 'number' ? options.limit : null
|
|
148
|
-
const channel = getOrCreateChannel(toastName, defaults, channelLimit)
|
|
149
|
-
const merged = { ...channel.value.defaults, ...defaults, ...toast }
|
|
150
|
-
const position = merged.position ?? 'bottom-center'
|
|
151
|
-
const duration = merged.duration ?? 0
|
|
152
|
-
const status = merged.status ?? 'default'
|
|
153
|
-
if (import.meta.env.NODE_ENV !== 'production' && !toastName) {
|
|
154
|
-
console.warn('[addToast] Toast channel name is empty or invalid. Falling back to "default".')
|
|
155
|
-
}
|
|
156
|
-
const id = nextToastIdRef.value++
|
|
157
|
-
const newToast = normalizeToast(
|
|
158
|
-
reactive({
|
|
159
|
-
id,
|
|
160
|
-
...merged,
|
|
161
|
-
name: toastName,
|
|
162
|
-
position,
|
|
163
|
-
countdown: duration,
|
|
164
|
-
originalDuration: duration,
|
|
165
|
-
status,
|
|
166
|
-
progress: typeof merged.progress === 'number' ? merged.progress : undefined,
|
|
167
|
-
ariaLive: merged.ariaLive ?? 'polite',
|
|
168
|
-
intervalId: undefined as number | undefined,
|
|
169
|
-
}),
|
|
170
|
-
)
|
|
171
|
-
|
|
172
|
-
// If limit is set and reached, queue the toast
|
|
173
|
-
if (channel.value.toastLimit && channel.value.toasts.length >= channel.value.toastLimit) {
|
|
174
|
-
;(channel.value.toastQueue ??= []).push(newToast)
|
|
175
|
-
return id
|
|
176
|
-
}
|
|
177
|
-
channel.value.toasts.push(newToast)
|
|
178
|
-
// Ensure timer always starts for visible toasts
|
|
179
|
-
if (channel.value.toasts.includes(newToast)) {
|
|
180
|
-
startToastTimer(newToast)
|
|
181
|
-
}
|
|
182
|
-
return id
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
function removeToast(id: number) {
|
|
186
|
-
const idx = channel.value.toasts.findIndex(t => t.id === id)
|
|
187
|
-
if (idx !== -1) {
|
|
188
|
-
// Defensive: clear countdown timer if present
|
|
189
|
-
const toast = channel.value.toasts[idx] as Toast & { intervalId?: number }
|
|
190
|
-
if (toast.intervalId) {
|
|
191
|
-
clearInterval(toast.intervalId)
|
|
192
|
-
}
|
|
193
|
-
channel.value.toasts.splice(idx, 1)
|
|
194
|
-
// If queue exists, pop next toast
|
|
195
|
-
if (channel.value.toastLimit && (channel.value.toastQueue?.length ?? 0) > 0) {
|
|
196
|
-
const next = channel.value.toastQueue!.shift()
|
|
197
|
-
if (next) {
|
|
198
|
-
const norm = normalizeToast(next)
|
|
199
|
-
channel.value.toasts.push(norm)
|
|
200
|
-
// Ensure timer always starts for visible toasts
|
|
201
|
-
if (channel.value.toasts.includes(norm)) {
|
|
202
|
-
startToastTimer(norm)
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
function clearToasts() {
|
|
210
|
-
channel.value.toasts = []
|
|
211
|
-
if (channel.value.toastQueue) {
|
|
212
|
-
channel.value.toastQueue.length = 0
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
/**
|
|
217
|
-
* Update or replace a toast by id
|
|
218
|
-
*/
|
|
219
|
-
function updateToast(id: number, updates: Partial<Toast>) {
|
|
220
|
-
const toast = channel.value.toasts.find(t => t.id === id)
|
|
221
|
-
if (toast) {
|
|
222
|
-
Object.assign(toast, updates)
|
|
223
|
-
normalizeToast(toast)
|
|
224
|
-
// If updating countdown/duration, recalculate progress
|
|
225
|
-
if (typeof toast.countdown === 'number' && typeof toast.duration === 'number' && toast.duration > 0) {
|
|
226
|
-
toast.progress = Math.max(0, toast.countdown / toast.duration)
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
/**
|
|
232
|
-
* Show a toast for the duration of a promise
|
|
233
|
-
* Sets status to 'pending', then 'success' or 'error' on resolve/reject
|
|
234
|
-
*/
|
|
235
|
-
function toastPromise<T>(
|
|
236
|
-
promise: Promise<T>,
|
|
237
|
-
options: {
|
|
238
|
-
pending: Omit<Toast, 'id'>
|
|
239
|
-
success: Omit<Toast, 'id'>
|
|
240
|
-
error: Omit<Toast, 'id'>
|
|
241
|
-
name?: string
|
|
242
|
-
},
|
|
243
|
-
): Promise<T> {
|
|
244
|
-
const toastName = options.name?.trim() || name
|
|
245
|
-
if (import.meta.env.NODE_ENV !== 'production' && !toastName) {
|
|
246
|
-
console.warn('[toastPromise] Toast channel name is empty or invalid. Falling back to "default".')
|
|
247
|
-
}
|
|
248
|
-
const promiseId = `promise-${Date.now()}-${Math.random()}`
|
|
249
|
-
const pendingId = addToast({
|
|
250
|
-
...options.pending,
|
|
251
|
-
status: 'pending',
|
|
252
|
-
promiseId,
|
|
253
|
-
message: options.pending.message,
|
|
254
|
-
name: toastName,
|
|
255
|
-
})
|
|
256
|
-
return promise.then(
|
|
257
|
-
result => {
|
|
258
|
-
updateToast(pendingId, {
|
|
259
|
-
...options.success,
|
|
260
|
-
status: 'success',
|
|
261
|
-
promiseId,
|
|
262
|
-
message: options.success.message,
|
|
263
|
-
name: toastName,
|
|
264
|
-
})
|
|
265
|
-
return result
|
|
266
|
-
},
|
|
267
|
-
err => {
|
|
268
|
-
updateToast(pendingId, {
|
|
269
|
-
...options.error,
|
|
270
|
-
status: 'error',
|
|
271
|
-
promiseId,
|
|
272
|
-
message: options.error.message,
|
|
273
|
-
name: toastName,
|
|
274
|
-
})
|
|
275
|
-
throw err
|
|
276
|
-
},
|
|
277
|
-
)
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
/**
|
|
281
|
-
* Set a maximum number of visible toasts (queue extras)
|
|
282
|
-
*/
|
|
283
|
-
function setToastLimit(limit: number) {
|
|
284
|
-
channel.value.toastLimit = limit
|
|
285
|
-
if (channel.value.toastLimit) {
|
|
286
|
-
// If over limit, move extras to queue
|
|
287
|
-
while (channel.value.toasts.length > channel.value.toastLimit) {
|
|
288
|
-
const removed = channel.value.toasts.pop()
|
|
289
|
-
if (removed) {
|
|
290
|
-
// Stop timer for toast leaving visible list
|
|
291
|
-
if (removed.intervalId) {
|
|
292
|
-
clearInterval(removed.intervalId)
|
|
293
|
-
removed.intervalId = undefined
|
|
294
|
-
}
|
|
295
|
-
;(channel.value.toastQueue ??= []).unshift(removed)
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
// If under limit and queue has items, fill up
|
|
299
|
-
while (channel.value.toasts.length < channel.value.toastLimit && (channel.value.toastQueue?.length ?? 0) > 0) {
|
|
300
|
-
const next = channel.value.toastQueue!.shift()
|
|
301
|
-
if (next) {
|
|
302
|
-
const norm = normalizeToast(next)
|
|
303
|
-
channel.value.toasts.push(norm)
|
|
304
|
-
// Ensure timer always starts for visible toasts
|
|
305
|
-
if (channel.value.toasts.includes(norm)) {
|
|
306
|
-
startToastTimer(norm)
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
function startToastTimer(
|
|
314
|
-
toast: Toast & { countdown: number; originalDuration: number; intervalId?: number; startTime?: number },
|
|
315
|
-
) {
|
|
316
|
-
if (toast.originalDuration > 0) {
|
|
317
|
-
if (toast.intervalId) {
|
|
318
|
-
clearInterval(toast.intervalId)
|
|
319
|
-
}
|
|
320
|
-
const start = Date.now()
|
|
321
|
-
toast.startTime = start
|
|
322
|
-
|
|
323
|
-
toast.intervalId = setInterval(() => {
|
|
324
|
-
const elapsed = Date.now() - (toast.startTime ?? start)
|
|
325
|
-
toast.countdown = Math.max(0, toast.originalDuration - elapsed)
|
|
326
|
-
toast.progress = Math.max(0, toast.countdown / toast.originalDuration)
|
|
327
|
-
if (toast.countdown <= 0) {
|
|
328
|
-
clearInterval(toast.intervalId)
|
|
329
|
-
removeToast(toast.id)
|
|
330
|
-
}
|
|
331
|
-
}, 16) as unknown as number // 60fps for smooth animation
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
return {
|
|
336
|
-
toasts: computed(() => channel.value.toasts),
|
|
337
|
-
addToast,
|
|
338
|
-
removeToast,
|
|
339
|
-
clearToasts,
|
|
340
|
-
updateToast,
|
|
341
|
-
toastPromise,
|
|
342
|
-
setToastLimit,
|
|
343
|
-
name,
|
|
344
|
-
}
|
|
345
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
const isSearchOpen = ref(false)
|
|
2
|
-
|
|
3
|
-
export function useSearch() {
|
|
4
|
-
function openSearch() {
|
|
5
|
-
isSearchOpen.value = true
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
function closeSearch() {
|
|
9
|
-
isSearchOpen.value = false
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
function toggleSearch() {
|
|
13
|
-
isSearchOpen.value = !isSearchOpen.value
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
return {
|
|
17
|
-
isSearchOpen,
|
|
18
|
-
openSearch,
|
|
19
|
-
closeSearch,
|
|
20
|
-
toggleSearch,
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { reactive } from 'vue'
|
|
2
|
-
|
|
3
|
-
export interface DrawerState {
|
|
4
|
-
name: string
|
|
5
|
-
isDrawerOpen: boolean
|
|
6
|
-
openDrawer: () => void
|
|
7
|
-
closeDrawer: () => void
|
|
8
|
-
toggleDrawer: () => void
|
|
9
|
-
}
|
|
10
|
-
export interface Drawers {
|
|
11
|
-
[key: string]: DrawerState
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export const drawers = reactive<Drawers>({})
|
|
15
|
-
|
|
16
|
-
export function createDrawerState(name: string) {
|
|
17
|
-
const drawerState =
|
|
18
|
-
drawers[name] ||
|
|
19
|
-
reactive<DrawerState>({
|
|
20
|
-
name,
|
|
21
|
-
isDrawerOpen: false,
|
|
22
|
-
openDrawer() {
|
|
23
|
-
drawerState.isDrawerOpen = true
|
|
24
|
-
},
|
|
25
|
-
closeDrawer() {
|
|
26
|
-
drawerState.isDrawerOpen = false
|
|
27
|
-
},
|
|
28
|
-
toggleDrawer() {
|
|
29
|
-
drawerState.isDrawerOpen = !drawerState.isDrawerOpen
|
|
30
|
-
},
|
|
31
|
-
})
|
|
32
|
-
drawers[name] = drawerState
|
|
33
|
-
return drawerState
|
|
34
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Maps placement values to CSS position-area values for anchor positioning
|
|
3
|
-
*
|
|
4
|
-
* Using span to align edges:
|
|
5
|
-
* - "bottom span-right" = below anchor, aligned to left edge (spans from left to center)
|
|
6
|
-
* - "bottom span-left" = below anchor, aligned to right edge (spans from center to right)
|
|
7
|
-
*/
|
|
8
|
-
export function getPositionArea(placement: string): string {
|
|
9
|
-
const positionMap: Record<string, string> = {
|
|
10
|
-
// Top positions
|
|
11
|
-
top: 'center top', // centered above
|
|
12
|
-
'top-start': 'top span-right', // above, left edge aligned
|
|
13
|
-
'top-end': 'top span-left', // above, right edge aligned
|
|
14
|
-
|
|
15
|
-
// Right positions
|
|
16
|
-
right: 'center right', // centered to right
|
|
17
|
-
'right-start': 'right span-bottom', // right, top edge aligned
|
|
18
|
-
'right-end': 'right span-top', // right, bottom edge aligned
|
|
19
|
-
|
|
20
|
-
// Bottom positions (most common for dropdowns)
|
|
21
|
-
bottom: 'center bottom', // centered below
|
|
22
|
-
'bottom-start': 'bottom span-right', // below, left edge aligned
|
|
23
|
-
'bottom-end': 'bottom span-left', // below, right edge aligned
|
|
24
|
-
|
|
25
|
-
// Left positions
|
|
26
|
-
left: 'center left', // centered to left
|
|
27
|
-
'left-start': 'left span-bottom', // left, top edge aligned
|
|
28
|
-
'left-end': 'left span-top', // left, bottom edge aligned
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return positionMap[placement] || 'bottom span-right'
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Gets position-try-fallbacks for automatic repositioning
|
|
36
|
-
*/
|
|
37
|
-
export function getPositionFallbacks(_placement: string): string {
|
|
38
|
-
// Simple flip fallbacks - flip to opposite side on same axis
|
|
39
|
-
return 'flip-block, flip-inline'
|
|
40
|
-
}
|
package/components.d.ts
DELETED
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import type { DefineComponent } from 'vue'
|
|
2
|
-
|
|
3
|
-
type Component = DefineComponent<object, object, unknown>
|
|
4
|
-
|
|
5
|
-
export declare const Accordion: Component
|
|
6
|
-
export declare const Alert: Component
|
|
7
|
-
export declare const Avatar: Component
|
|
8
|
-
export declare const AvatarGroup: Component
|
|
9
|
-
export declare const Badge: Component
|
|
10
|
-
export declare const Breadcrumbs: Component
|
|
11
|
-
export declare const Button: Component
|
|
12
|
-
export declare const Calendar: Component
|
|
13
|
-
export declare const CalendarInput: Component
|
|
14
|
-
export declare const CalendarSkeleton: Component
|
|
15
|
-
export declare const Card: Component
|
|
16
|
-
export declare const CardActions: Component
|
|
17
|
-
export declare const CardBody: Component
|
|
18
|
-
export declare const CardTitle: Component
|
|
19
|
-
export declare const Carousel: Component
|
|
20
|
-
export declare const CarouselItem: Component
|
|
21
|
-
export declare const Chat: Component
|
|
22
|
-
export declare const ChatBubble: Component
|
|
23
|
-
export declare const ChatFooter: Component
|
|
24
|
-
export declare const ChatHeader: Component
|
|
25
|
-
export declare const ChatImage: Component
|
|
26
|
-
export declare const Checkbox: Component
|
|
27
|
-
export declare const Collapse: Component
|
|
28
|
-
export declare const CollapseContent: Component
|
|
29
|
-
export declare const CollapseTitle: Component
|
|
30
|
-
export declare const Countdown: Component
|
|
31
|
-
export declare const CountdownTimers: Component
|
|
32
|
-
export declare const Counter: Component
|
|
33
|
-
export declare const Crumb: Component
|
|
34
|
-
export declare const DaisyLink: Component
|
|
35
|
-
export declare const Diff: Component
|
|
36
|
-
export declare const Divider: Component
|
|
37
|
-
export declare const Dock: Component
|
|
38
|
-
export declare const DockItem: Component
|
|
39
|
-
export declare const DockLabel: Component
|
|
40
|
-
export declare const Drawer: Component
|
|
41
|
-
export declare const DrawerContent: Component
|
|
42
|
-
export declare const DrawerSide: Component
|
|
43
|
-
export declare const Dropdown: Component
|
|
44
|
-
export declare const DropdownButton: Component
|
|
45
|
-
export declare const DropdownContent: Component
|
|
46
|
-
export declare const DropdownTarget: Component
|
|
47
|
-
export declare const Fab: Component
|
|
48
|
-
export declare const FabClose: Component
|
|
49
|
-
export declare const FabMainAction: Component
|
|
50
|
-
export declare const FabTrigger: Component
|
|
51
|
-
export declare const Fieldset: Component
|
|
52
|
-
export declare const FileInput: Component
|
|
53
|
-
export declare const Filter: Component
|
|
54
|
-
export declare const Flex: Component
|
|
55
|
-
export declare const FlexItem: Component
|
|
56
|
-
export declare const Footer: Component
|
|
57
|
-
export declare const FooterTitle: Component
|
|
58
|
-
export declare const FormControl: Component
|
|
59
|
-
export declare const Hero: Component
|
|
60
|
-
export declare const HeroContent: Component
|
|
61
|
-
export declare const HeroOverlay: Component
|
|
62
|
-
export declare const Hover3D: Component
|
|
63
|
-
export declare const HoverGallery: Component
|
|
64
|
-
export declare const Indicator: Component
|
|
65
|
-
export declare const IndicatorItem: Component
|
|
66
|
-
export declare const Input: Component
|
|
67
|
-
export declare const Join: Component
|
|
68
|
-
export declare const Kbd: Component
|
|
69
|
-
export declare const Label: Component
|
|
70
|
-
export declare const List: Component
|
|
71
|
-
export declare const ListColGrow: Component
|
|
72
|
-
export declare const ListColWrap: Component
|
|
73
|
-
export declare const ListRow: Component
|
|
74
|
-
export declare const LoadingBall: Component
|
|
75
|
-
export declare const LoadingBars: Component
|
|
76
|
-
export declare const LoadingDots: Component
|
|
77
|
-
export declare const LoadingInfinity: Component
|
|
78
|
-
export declare const LoadingRing: Component
|
|
79
|
-
export declare const LoadingSpinner: Component
|
|
80
|
-
export declare const Mask: Component
|
|
81
|
-
export declare const Menu: Component
|
|
82
|
-
export declare const MenuExpand: Component
|
|
83
|
-
export declare const MenuExpandToggle: Component
|
|
84
|
-
export declare const MenuItem: Component
|
|
85
|
-
export declare const MenuTitle: Component
|
|
86
|
-
export declare const MockupBrowser: Component
|
|
87
|
-
export declare const MockupBrowserToolbar: Component
|
|
88
|
-
export declare const MockupCode: Component
|
|
89
|
-
export declare const MockupPhone: Component
|
|
90
|
-
export declare const MockupWindow: Component
|
|
91
|
-
export declare const Modal: Component
|
|
92
|
-
export declare const ModalAction: Component
|
|
93
|
-
export declare const ModalBox: Component
|
|
94
|
-
export declare const NavButton: Component
|
|
95
|
-
export declare const Navbar: Component
|
|
96
|
-
export declare const NavbarCenter: Component
|
|
97
|
-
export declare const NavbarEnd: Component
|
|
98
|
-
export declare const NavbarStart: Component
|
|
99
|
-
export declare const Progress: Component
|
|
100
|
-
export declare const Prose: Component
|
|
101
|
-
export declare const RadialProgress: Component
|
|
102
|
-
export declare const Radio: Component
|
|
103
|
-
export declare const RadioGroup: Component
|
|
104
|
-
export declare const Range: Component
|
|
105
|
-
export declare const RangeMeasure: Component
|
|
106
|
-
export declare const RangeMeasureTick: Component
|
|
107
|
-
export declare const Rating: Component
|
|
108
|
-
export declare const Select: Component
|
|
109
|
-
export declare const Skeleton: Component
|
|
110
|
-
export declare const SkeletonText: Component
|
|
111
|
-
export declare const Stack: Component
|
|
112
|
-
export declare const Stat: Component
|
|
113
|
-
export declare const StatActions: Component
|
|
114
|
-
export declare const StatDesc: Component
|
|
115
|
-
export declare const StatFigure: Component
|
|
116
|
-
export declare const StatTitle: Component
|
|
117
|
-
export declare const StatValue: Component
|
|
118
|
-
export declare const Stats: Component
|
|
119
|
-
export declare const Status: Component
|
|
120
|
-
export declare const Step: Component
|
|
121
|
-
export declare const StepIcon: Component
|
|
122
|
-
export declare const Steps: Component
|
|
123
|
-
export declare const Swap: Component
|
|
124
|
-
export declare const Tab: Component
|
|
125
|
-
export declare const TabContent: Component
|
|
126
|
-
export declare const Table: Component
|
|
127
|
-
export declare const Tabs: Component
|
|
128
|
-
export declare const Text: Component
|
|
129
|
-
export declare const TextArea: Component
|
|
130
|
-
export declare const TextRotate: Component
|
|
131
|
-
export declare const ThemeController: Component
|
|
132
|
-
export declare const ThemeProvider: Component
|
|
133
|
-
export declare const ThemeTile: Component
|
|
134
|
-
export declare const Timeline: Component
|
|
135
|
-
export declare const TimelineEnd: Component
|
|
136
|
-
export declare const TimelineItem: Component
|
|
137
|
-
export declare const TimelineLine: Component
|
|
138
|
-
export declare const TimelineMiddle: Component
|
|
139
|
-
export declare const TimelineStart: Component
|
|
140
|
-
export declare const Toast: Component
|
|
141
|
-
export declare const Toggle: Component
|
|
142
|
-
export declare const Tooltip: Component
|
|
143
|
-
export declare const TooltipContent: Component
|
|
144
|
-
export declare const TooltipTarget: Component
|
|
145
|
-
export declare const ValidatorHint: Component
|