daisy-ui-kit 5.2.4 → 5.2.7

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 (57) hide show
  1. package/README.md +3 -1
  2. package/app/components/Avatar.vue +1 -1
  3. package/app/components/MenuItem.vue +10 -5
  4. package/app/components/Prose.vue +7 -7
  5. package/app/composables/use-toast.ts +2 -6
  6. package/package.json +52 -44
  7. package/app/components/content/CodeWrapper.vue +0 -8
  8. package/app/components/content/ColorBadge.vue +0 -24
  9. package/app/components/content/ComponentsTree.vue +0 -39
  10. package/app/components/content/DarkToggle.vue +0 -13
  11. package/app/components/content/DemoExampleResponsive.vue +0 -67
  12. package/app/components/content/IframeRenderer.ts +0 -57
  13. package/app/components/content/Indent.vue +0 -3
  14. package/app/components/content/LocalLinks.vue +0 -30
  15. package/app/components/content/Logo.vue +0 -8
  16. package/app/components/content/NotFound.vue +0 -38
  17. package/app/components/content/PageNext.vue +0 -25
  18. package/app/components/content/PagePrevious.vue +0 -25
  19. package/app/components/content/ProseA.vue +0 -19
  20. package/app/components/content/ProseAlert.vue +0 -11
  21. package/app/components/content/ProseBlockquote.vue +0 -11
  22. package/app/components/content/ProseCode.vue +0 -3
  23. package/app/components/content/ProseEm.vue +0 -5
  24. package/app/components/content/ProseH1.vue +0 -22
  25. package/app/components/content/ProseH2.vue +0 -22
  26. package/app/components/content/ProseH3.vue +0 -22
  27. package/app/components/content/ProseH4.vue +0 -22
  28. package/app/components/content/ProseH5.vue +0 -22
  29. package/app/components/content/ProseH6.vue +0 -22
  30. package/app/components/content/ProseHr.vue +0 -3
  31. package/app/components/content/ProseImg.vue +0 -40
  32. package/app/components/content/ProseLi.vue +0 -3
  33. package/app/components/content/ProseOl.vue +0 -5
  34. package/app/components/content/ProseP.vue +0 -3
  35. package/app/components/content/ProsePre.vue +0 -38
  36. package/app/components/content/ProsePre2.vue +0 -68
  37. package/app/components/content/ProseStrong.vue +0 -5
  38. package/app/components/content/ProseTable.vue +0 -7
  39. package/app/components/content/ProseTbody.vue +0 -5
  40. package/app/components/content/ProseTd.vue +0 -5
  41. package/app/components/content/ProseTh.vue +0 -5
  42. package/app/components/content/ProseThead.vue +0 -5
  43. package/app/components/content/ProseTr.vue +0 -5
  44. package/app/components/content/ProseUl.vue +0 -5
  45. package/app/components/content/Search.vue +0 -171
  46. package/app/components/content/SearchButton.vue +0 -14
  47. package/app/components/content/SearchModal.vue +0 -292
  48. package/app/components/content/Sidebar.vue +0 -87
  49. package/app/components/content/SidebarMenuSection.vue +0 -43
  50. package/app/components/content/SigninForm.vue +0 -34
  51. package/app/components/content/TableOfContents.vue +0 -304
  52. package/app/components/content/TocTree.vue +0 -66
  53. package/app/components/content/TypeBadge.vue +0 -18
  54. package/app/components/content/UserMenu.vue +0 -48
  55. package/app/composables/__tests__/use-calendar.test.ts +0 -239
  56. package/app/composables/useSearch.ts +0 -24
  57. package/app/utils/debug-shim.mjs +0 -23
@@ -1,292 +0,0 @@
1
- <script setup lang="ts">
2
- import { onKeyStroke, useMagicKeys } from '@vueuse/core'
3
- import { useFuse } from '@vueuse/integrations/useFuse'
4
- import { computed, nextTick, ref, watch } from 'vue'
5
-
6
- const { isSearchOpen, openSearch, closeSearch } = useSearch()
7
- const { themes, setTheme } = useDaisyTheme()
8
-
9
- // Handle escape key
10
- onKeyStroke('Escape', () => {
11
- if (isSearchOpen.value) {
12
- closeSearch()
13
- }
14
- })
15
-
16
- // meta|ctrl+k --> toggle the search modal
17
- const { meta, control } = useMagicKeys()
18
- onKeyStroke('k', e => {
19
- if (meta?.value || control?.value) {
20
- e.preventDefault()
21
- openSearch()
22
- }
23
- })
24
-
25
- const search = ref('')
26
- const searchInput = ref<HTMLInputElement | null>(null)
27
- const { allLinks } = useNav()
28
-
29
- // Build theme search items
30
- const themeItems = themes.value
31
- .filter(t => t.theme !== 'system')
32
- .map(t => ({
33
- label: t.theme,
34
- to: '',
35
- tags: ['theme'],
36
- isTheme: true,
37
- }))
38
-
39
- const allSearchItems = [...allLinks, ...themeItems]
40
-
41
- const tags = allSearchItems.flatMap(item => item.tags)
42
- const matchingTag = computed(() => {
43
- if (search.value.length < 2) {
44
- return null
45
- }
46
- return tags.find(tag => tag.toLowerCase().startsWith(search.value.toLowerCase()))
47
- })
48
-
49
- // search results and popular results
50
- const { results } = useFuse(search, allSearchItems, {
51
- fuseOptions: { keys: ['label', 'tags'], includeScore: true, distance: 3 },
52
- resultLimit: 12,
53
- })
54
-
55
- // Split results into nav links and themes
56
- const navResults = computed(() => results.value.filter(r => !(r.item as any).isTheme))
57
- const themeResults = computed(() => {
58
- const fromFuse = results.value.filter(r => (r.item as any).isTheme)
59
- // If user typed "theme", show all themes (fuse's resultLimit caps at 12)
60
- if (fromFuse.length > 0 && matchingTag.value === 'theme') {
61
- return themeItems.map(item => ({ item }))
62
- }
63
- return fromFuse
64
- })
65
-
66
- const popularResults = ['Button', 'Menu', 'Drawer', 'Tabs', 'Dropdown']
67
- .map(label => allLinks.find(item => item.label === label)!)
68
- .filter(Boolean)
69
- .map(item => ({ item }))
70
-
71
- const newResults = allLinks
72
- .filter(item => item.tags?.includes('new'))
73
- .slice(0, 5)
74
- .map(item => ({ item }))
75
-
76
- // Combined default results for keyboard navigation
77
- const allDefaultResults = computed(() => [...popularResults, ...newResults])
78
-
79
- const eitherResults = computed(() => {
80
- if (results.value.length === 0) {
81
- return allDefaultResults.value
82
- }
83
- return [...navResults.value, ...themeResults.value]
84
- })
85
-
86
- // track the highlighted index in the list
87
- const highlightedIndex = ref(0)
88
- const resultsContainer = ref<HTMLElement | null>(null)
89
- const highlightedItem = computed(() => {
90
- return eitherResults.value[highlightedIndex.value]?.item
91
- })
92
-
93
- // scroll highlighted item into view
94
- watch(highlightedIndex, () => {
95
- nextTick(() => {
96
- const el = resultsContainer.value?.querySelector('[data-highlighted]')
97
- el?.scrollIntoView({ block: 'nearest' })
98
- })
99
- })
100
-
101
- // when results change, reset the highlighted index
102
- watch(eitherResults, () => {
103
- highlightedIndex.value = 0
104
- })
105
-
106
- // Focus input when modal opens
107
- watch(isSearchOpen, val => {
108
- if (val) {
109
- nextTick(() => {
110
- searchInput.value?.focus()
111
- })
112
- } else {
113
- search.value = ''
114
- highlightedIndex.value = 0
115
- }
116
- })
117
-
118
- // enter --> navigate to highlighted item or apply theme
119
- function handleEnter() {
120
- if (highlightedItem.value) {
121
- if ((highlightedItem.value as any).isTheme) {
122
- setTheme(highlightedItem.value.label)
123
- } else {
124
- navigateTo(highlightedItem.value.to)
125
- }
126
- closeSearch()
127
- }
128
- }
129
-
130
- function handleThemeClick(themeName: string) {
131
- setTheme(themeName)
132
- closeSearch()
133
- }
134
-
135
- // arrow up --> highlighted previous item
136
- function handleArrowUp() {
137
- highlightedIndex.value = Math.max(highlightedIndex.value - 1, 0)
138
- }
139
-
140
- // arrow down --> highlight next item
141
- function handleArrowDown() {
142
- highlightedIndex.value = Math.min(highlightedIndex.value + 1, eitherResults.value.length - 1)
143
- }
144
-
145
- function handleResultClick(to: string) {
146
- navigateTo(to)
147
- closeSearch()
148
- }
149
- </script>
150
-
151
- <template>
152
- <ClientOnly>
153
- <Teleport to="body">
154
- <Modal v-model="isSearchOpen">
155
- <ModalBox class="p-0 max-w-lg overflow-hidden">
156
- <!-- Search Input -->
157
- <div class="flex items-center gap-3 p-4 border-b border-base-300">
158
- <Icon name="heroicons-solid:search" class="size-5 opacity-60 shrink-0" />
159
- <input
160
- ref="searchInput"
161
- v-model="search"
162
- type="text"
163
- placeholder="Search components, docs..."
164
- class="flex-1 bg-transparent outline-none text-lg"
165
- @keydown.enter="handleEnter"
166
- @keydown.arrow-up.prevent="handleArrowUp"
167
- @keydown.arrow-down.prevent="handleArrowDown"
168
- />
169
- <Kbd sm class="opacity-50">ESC</Kbd>
170
- </div>
171
-
172
- <!-- Results -->
173
- <div ref="resultsContainer" class="max-h-[60vh] overflow-y-auto">
174
- <div v-if="!search.length" class="p-2">
175
- <Text sm class="px-3 py-2 opacity-50 uppercase tracking-wider">Popular</Text>
176
- <Menu class="w-full">
177
- <MenuItem
178
- v-for="(result, index) in popularResults"
179
- :key="result.item.label"
180
- :class="{ 'bg-primary/10': index === highlightedIndex }"
181
- :data-highlighted="index === highlightedIndex ? '' : undefined"
182
- >
183
- <a class="flex items-center gap-3" @click="handleResultClick(result.item.to)">
184
- <Icon
185
- v-if="(result.item as any).icon"
186
- :name="(result.item as any).icon"
187
- class="size-5 opacity-60"
188
- />
189
- <span>{{ result.item.label }}</span>
190
- </a>
191
- </MenuItem>
192
- </Menu>
193
-
194
- <Text sm class="px-3 py-2 mt-4 opacity-50 uppercase tracking-wider">New</Text>
195
- <Menu class="w-full">
196
- <MenuItem
197
- v-for="(result, index) in newResults"
198
- :key="result.item.label"
199
- :class="{ 'bg-primary/10': index + popularResults.length === highlightedIndex }"
200
- :data-highlighted="index + popularResults.length === highlightedIndex ? '' : undefined"
201
- >
202
- <a class="flex items-center gap-3" @click="handleResultClick(result.item.to)">
203
- <Icon
204
- v-if="(result.item as any).icon"
205
- :name="(result.item as any).icon"
206
- class="size-5 opacity-60"
207
- />
208
- <span class="flex-1">{{ result.item.label }}</span>
209
- <Badge primary sm>New</Badge>
210
- </a>
211
- </MenuItem>
212
- </Menu>
213
- </div>
214
-
215
- <div v-else-if="results.length" class="p-2">
216
- <template v-if="navResults.length">
217
- <Text sm class="px-3 py-2 opacity-50 uppercase tracking-wider">Results</Text>
218
- <Menu class="w-full">
219
- <MenuItem
220
- v-for="(result, index) in navResults"
221
- :key="result.item.label"
222
- :class="{ 'bg-primary/10': index === highlightedIndex }"
223
- :data-highlighted="index === highlightedIndex ? '' : undefined"
224
- >
225
- <a class="flex items-center gap-3" @click="handleResultClick(result.item.to)">
226
- <Icon
227
- v-if="(result.item as any).icon"
228
- :name="(result.item as any).icon"
229
- class="size-5 opacity-60"
230
- />
231
- <span class="flex-1">{{ result.item.label }}</span>
232
- <Badge v-if="matchingTag && result.item.tags.includes(matchingTag)" warning sm>
233
- {{ matchingTag }}
234
- </Badge>
235
- </a>
236
- </MenuItem>
237
- </Menu>
238
- </template>
239
-
240
- <template v-if="themeResults.length">
241
- <Text sm class="px-3 py-2 opacity-50 uppercase tracking-wider" :class="{ 'mt-4': navResults.length }">
242
- Themes
243
- </Text>
244
- <Menu class="w-full">
245
- <li
246
- v-for="(result, index) in themeResults"
247
- :key="result.item.label"
248
- :data-theme="result.item.label"
249
- :data-highlighted="index + navResults.length === highlightedIndex ? '' : undefined"
250
- >
251
- <a
252
- class="flex items-center gap-3"
253
- :style="{ backgroundColor: 'var(--color-base-100)', color: 'var(--color-base-content)' }"
254
- :class="{ 'bg-primary! text-primary-content!': index + navResults.length === highlightedIndex }"
255
- @click="handleThemeClick(result.item.label)"
256
- >
257
- <ThemeTile :theme="result.item.label" xs class="size-5!" />
258
- <span class="flex-1">{{ result.item.label }}</span>
259
- </a>
260
- </li>
261
- </Menu>
262
- </template>
263
- </div>
264
-
265
- <div v-else class="p-8 text-center">
266
- <Icon name="heroicons-outline:search" class="size-12 opacity-20 mx-auto mb-4" />
267
- <Text class="opacity-60">No results found for "{{ search }}"</Text>
268
- <Text sm class="opacity-40 mt-1">Try searching for something else</Text>
269
- </div>
270
- </div>
271
-
272
- <!-- Footer -->
273
- <div class="flex items-center gap-4 p-3 border-t border-base-300 text-xs opacity-50">
274
- <span class="flex items-center gap-1">
275
- <Kbd xs>↑</Kbd>
276
- <Kbd xs>↓</Kbd>
277
- to navigate
278
- </span>
279
- <span class="flex items-center gap-1">
280
- <Kbd xs>↵</Kbd>
281
- to select
282
- </span>
283
- <span class="flex items-center gap-1">
284
- <Kbd xs>esc</Kbd>
285
- to close
286
- </span>
287
- </div>
288
- </ModalBox>
289
- </Modal>
290
- </Teleport>
291
- </ClientOnly>
292
- </template>
@@ -1,87 +0,0 @@
1
- <script setup>
2
- import { nextTick, onMounted, watch } from 'vue'
3
-
4
- const route = useRoute()
5
- const { docsLinks, actions, dataDisplay, dataInput, feedback, layout, navigation, mockup } = useNav()
6
-
7
- const drawerState = createDrawerState('docs')
8
- const sidebarRef = ref(null)
9
-
10
- function scrollToActiveLink() {
11
- nextTick(() => {
12
- setTimeout(() => {
13
- const el = sidebarRef.value?.$el || sidebarRef.value
14
- const activeLink = el?.querySelector('.menu-active')
15
- if (activeLink) {
16
- activeLink.scrollIntoView({ block: 'center', behavior: 'smooth' })
17
- }
18
- }, 100)
19
- })
20
- }
21
-
22
- watch(
23
- () => route.path,
24
- () => {
25
- drawerState.isDrawerOpen = false
26
- scrollToActiveLink()
27
- },
28
- )
29
-
30
- onMounted(() => {
31
- scrollToActiveLink()
32
- })
33
- </script>
34
-
35
- <template>
36
- <div class="relative pt-4 menu w-80 bg-base-100 text-base-content min-h-full">
37
- <NuxtLink to="/" class="fixed">
38
- <Logo class="ml-8 text-4xl text-base-content" />
39
- </NuxtLink>
40
-
41
- <Flex ref="sidebarRef" col class="pb-12 pl-2 mt-12 overflow-y-auto">
42
- <SidebarMenuSection :links="docsLinks" no-divider class="pt-4" />
43
- <SidebarMenuSection
44
- title="Actions"
45
- title-icon="mdi:cursor-default-click"
46
- title-icon-classes="text-fuchsia-600 w-5 h-5"
47
- :links="actions"
48
- />
49
- <SidebarMenuSection
50
- title="Data Display"
51
- title-icon="ph:app-window-bold"
52
- title-icon-classes="text-teal-600 w-5 h-5"
53
- :links="dataDisplay"
54
- />
55
- <SidebarMenuSection
56
- title="Navigation"
57
- title-icon="mdi:link-variant"
58
- title-icon-classes="text-cyan-600 w-5 h-5"
59
- :links="navigation"
60
- />
61
- <SidebarMenuSection
62
- title="Feedback"
63
- title-icon="ph:chat-centered-dots"
64
- title-icon-classes="text-orange-600 w-5 h-5"
65
- :links="feedback"
66
- />
67
- <SidebarMenuSection
68
- title="Data Input"
69
- title-icon="material-symbols:edit-square-outline"
70
- title-icon-classes="text-red-600 w-5 h-5"
71
- :links="dataInput"
72
- />
73
- <SidebarMenuSection
74
- title="Layout"
75
- title-icon="ic:round-grid-view"
76
- title-icon-classes="text-blue-600 w-5 h-5"
77
- :links="layout"
78
- />
79
- <SidebarMenuSection
80
- title="Mockup"
81
- title-icon="icon-park-outline:iphone"
82
- title-icon-classes="text-lime-600 w-5 h-5"
83
- :links="mockup"
84
- />
85
- </Flex>
86
- </div>
87
- </template>
@@ -1,43 +0,0 @@
1
- <script setup lang="ts">
2
- interface Link {
3
- label: string
4
- to: string
5
- pending: boolean
6
- pendingDocs: boolean
7
- icon?: string
8
- tags: string[]
9
- }
10
- defineProps<{
11
- title?: string
12
- titleIcon?: string
13
- titleIconClasses?: string
14
- links: Link[]
15
- noDivider?: boolean
16
- }>()
17
- </script>
18
-
19
- <template>
20
- <Menu class="w-full">
21
- <li v-if="!noDivider" />
22
- <MenuTitle v-if="titleIcon || title" class="flex flex-row items-center gap-3">
23
- <Icon v-if="titleIcon" :name="titleIcon as string" :class="titleIconClasses as string" />
24
- {{ title }}
25
- </MenuTitle>
26
-
27
- <MenuItem v-for="link in links" :key="link.label" :class="{ 'opacity-30': link.pending }">
28
- <NuxtLink :to="link.to" exact-active-class="menu-active" class="flex flex-row items-center">
29
- <Icon v-if="link.icon" :name="link.icon" class="w-5 h-5 mr-1" />
30
- <Text class="flex-grow">
31
- {{ link.label }}
32
- </Text>
33
- <Icon v-if="link.pendingDocs" name="feather:file-text" class="ml-2" />
34
- <Badge v-if="link.tags.includes('new')" sm soft accent class="ml-2"> new </Badge>
35
- <!-- <Tooltip v-if="link.tags.includes('examples')" tip="examples done" sm left>
36
- <Badge sm soft accent>
37
-
38
- </Badge>
39
- </Tooltip> -->
40
- </NuxtLink>
41
- </MenuItem>
42
- </Menu>
43
- </template>
@@ -1,34 +0,0 @@
1
- <template>
2
- <div class="flex items-center justify-center min-h-full px-4 py-12 sm:px-6 lg:px-8">
3
- <div class="w-full max-w-md space-y-8">
4
- <div>
5
- <img
6
- class="w-auto h-24 mx-auto invert"
7
- src="https://avatars.githubusercontent.com/u/85031756"
8
- alt="Feathers Cloud"
9
- />
10
- <h2 class="mt-6 text-3xl font-extrabold text-center text-gray-900">Sign in to your account</h2>
11
- </div>
12
- <div class="mt-8 space-y-6">
13
- <a
14
- type="button"
15
- class="relative flex justify-center w-full px-4 py-2 text-sm font-medium text-white bg-indigo-600 border border-transparent rounded-md group hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"
16
- href="/api/auth/login"
17
- >
18
- <span class="absolute inset-y-0 left-0 flex items-center pl-3">
19
- <Icon
20
- name="heroicons:lock-closed-solid"
21
- class="w-5 h-5 text-indigo-500 group-hover:text-indigo-400"
22
- aria-hidden="true"
23
- />
24
- </span>
25
- Sign in
26
- </a>
27
- <div class="text-center">
28
- or
29
- <RouterLink to="/" class="text-blue-500"> Return to Home </RouterLink>
30
- </div>
31
- </div>
32
- </div>
33
- </div>
34
- </template>