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,22 +0,0 @@
1
- <script setup lang="ts">
2
- import { computed, useRuntimeConfig } from '#imports'
3
-
4
- const props = defineProps<{ id?: string }>()
5
-
6
- const { headings } = useRuntimeConfig().public.mdc
7
- const generate = computed(
8
- () =>
9
- props.id &&
10
- ((typeof headings?.anchorLinks === 'boolean' && headings?.anchorLinks === true) ||
11
- (typeof headings?.anchorLinks === 'object' && headings?.anchorLinks?.h1)),
12
- )
13
- </script>
14
-
15
- <template>
16
- <h1 :id="props.id">
17
- <a v-if="id || generate" :href="`#${props.id}`">
18
- <slot />
19
- </a>
20
- <slot v-else />
21
- </h1>
22
- </template>
@@ -1,22 +0,0 @@
1
- <script setup lang="ts">
2
- import { computed, useRuntimeConfig } from '#imports'
3
-
4
- const props = defineProps<{ id?: string }>()
5
-
6
- const { headings } = useRuntimeConfig().public.mdc
7
- const generate = computed(
8
- () =>
9
- props.id &&
10
- ((typeof headings?.anchorLinks === 'boolean' && headings?.anchorLinks === true) ||
11
- (typeof headings?.anchorLinks === 'object' && headings?.anchorLinks?.h2)),
12
- )
13
- </script>
14
-
15
- <template>
16
- <h2 :id="props.id">
17
- <a v-if="id || generate" :href="`#${props.id}`">
18
- <slot />
19
- </a>
20
- <slot v-else />
21
- </h2>
22
- </template>
@@ -1,22 +0,0 @@
1
- <script setup lang="ts">
2
- import { computed, useRuntimeConfig } from '#imports'
3
-
4
- const props = defineProps<{ id?: string }>()
5
-
6
- const { headings } = useRuntimeConfig().public.mdc
7
- const generate = computed(
8
- () =>
9
- props.id &&
10
- ((typeof headings?.anchorLinks === 'boolean' && headings?.anchorLinks === true) ||
11
- (typeof headings?.anchorLinks === 'object' && headings?.anchorLinks?.h3)),
12
- )
13
- </script>
14
-
15
- <template>
16
- <h3 :id="props.id">
17
- <a v-if="id || generate" :href="`#${props.id}`">
18
- <slot />
19
- </a>
20
- <slot v-else />
21
- </h3>
22
- </template>
@@ -1,22 +0,0 @@
1
- <script setup lang="ts">
2
- import { computed, useRuntimeConfig } from '#imports'
3
-
4
- const props = defineProps<{ id?: string }>()
5
-
6
- const { headings } = useRuntimeConfig().public.mdc
7
- const generate = computed(
8
- () =>
9
- props.id &&
10
- ((typeof headings?.anchorLinks === 'boolean' && headings?.anchorLinks === true) ||
11
- (typeof headings?.anchorLinks === 'object' && headings?.anchorLinks?.h4)),
12
- )
13
- </script>
14
-
15
- <template>
16
- <h4 :id="props.id">
17
- <a v-if="id || generate" :href="`#${props.id}`">
18
- <slot />
19
- </a>
20
- <slot v-else />
21
- </h4>
22
- </template>
@@ -1,22 +0,0 @@
1
- <script setup lang="ts">
2
- import { computed, useRuntimeConfig } from '#imports'
3
-
4
- const props = defineProps<{ id?: string }>()
5
-
6
- const { headings } = useRuntimeConfig().public.mdc
7
- const generate = computed(
8
- () =>
9
- props.id &&
10
- ((typeof headings?.anchorLinks === 'boolean' && headings?.anchorLinks === true) ||
11
- (typeof headings?.anchorLinks === 'object' && headings?.anchorLinks?.h5)),
12
- )
13
- </script>
14
-
15
- <template>
16
- <h5 :id="props.id">
17
- <a v-if="id || generate" :href="`#${props.id}`">
18
- <slot />
19
- </a>
20
- <slot v-else />
21
- </h5>
22
- </template>
@@ -1,22 +0,0 @@
1
- <script setup lang="ts">
2
- import { computed, useRuntimeConfig } from '#imports'
3
-
4
- const props = defineProps<{ id?: string }>()
5
-
6
- const { headings } = useRuntimeConfig().public.mdc
7
- const generate = computed(
8
- () =>
9
- props.id &&
10
- ((typeof headings?.anchorLinks === 'boolean' && headings?.anchorLinks === true) ||
11
- (typeof headings?.anchorLinks === 'object' && headings?.anchorLinks?.h6)),
12
- )
13
- </script>
14
-
15
- <template>
16
- <h6 :id="props.id">
17
- <a v-if="id || generate" :href="`#${props.id}`">
18
- <slot />
19
- </a>
20
- <slot v-else />
21
- </h6>
22
- </template>
@@ -1,3 +0,0 @@
1
- <template>
2
- <hr />
3
- </template>
@@ -1,40 +0,0 @@
1
- <script setup lang="ts">
2
- import { computed, useRuntimeConfig } from '#imports'
3
-
4
- const props = defineProps({
5
- src: {
6
- type: String,
7
- default: '',
8
- },
9
- alt: {
10
- type: String,
11
- default: '',
12
- },
13
- width: {
14
- type: [String, Number],
15
- default: undefined,
16
- },
17
- height: {
18
- type: [String, Number],
19
- default: undefined,
20
- },
21
- })
22
-
23
- function withBase(input: string, base: string): string {
24
- if (!base || base === '/') return input
25
- const normalizedBase = base.endsWith('/') ? base.slice(0, -1) : base
26
- const normalizedInput = input.startsWith('/') ? input : `/${input}`
27
- return normalizedBase + normalizedInput
28
- }
29
-
30
- const refinedSrc = computed(() => {
31
- if (props.src?.startsWith('/') && !props.src.startsWith('//'))
32
- return withBase(props.src, useRuntimeConfig().app.baseURL)
33
-
34
- return props.src
35
- })
36
- </script>
37
-
38
- <template>
39
- <img :src="refinedSrc" :alt="alt" :width="width" :height="height" />
40
- </template>
@@ -1,3 +0,0 @@
1
- <template>
2
- <li><slot /></li>
3
- </template>
@@ -1,5 +0,0 @@
1
- <template>
2
- <ol>
3
- <slot />
4
- </ol>
5
- </template>
@@ -1,3 +0,0 @@
1
- <template>
2
- <p><slot /></p>
3
- </template>
@@ -1,38 +0,0 @@
1
- <script setup lang="ts">
2
- defineProps({
3
- code: {
4
- type: String,
5
- default: '',
6
- },
7
- language: {
8
- type: String,
9
- default: null,
10
- },
11
- filename: {
12
- type: String,
13
- default: null,
14
- },
15
- highlights: {
16
- type: Array as () => number[],
17
- default: () => [],
18
- },
19
- meta: {
20
- type: String,
21
- default: null,
22
- },
23
- class: {
24
- type: String,
25
- default: null,
26
- },
27
- })
28
- </script>
29
-
30
- <template>
31
- <pre :class="$props.class"><slot /></pre>
32
- </template>
33
-
34
- <style>
35
- pre code .line {
36
- display: block;
37
- }
38
- </style>
@@ -1,68 +0,0 @@
1
- <script setup lang="ts">
2
- import { useClipboard } from '@vueuse/core'
3
- import Button from '../Button.vue'
4
-
5
- const props = defineProps({
6
- code: {
7
- type: String,
8
- default: '',
9
- },
10
- language: {
11
- type: String,
12
- default: null,
13
- },
14
- filename: {
15
- type: String,
16
- default: null,
17
- },
18
- highlights: {
19
- type: Array as () => number[],
20
- default: () => [],
21
- },
22
- meta: {
23
- type: String,
24
- default: null,
25
- },
26
- class: {
27
- type: String,
28
- default: null,
29
- },
30
- })
31
-
32
- const { copy, copied } = useClipboard({ source: computed(() => props.code) })
33
- </script>
34
-
35
- <template>
36
- <div>
37
- <CodeWrapper v-if="meta?.includes('collapse=true')" class="code-wrapper">
38
- <div class="relative -my-6">
39
- <div class="absolute flex flex-row items-center top-0 right-0">
40
- <div v-if="copied" class="pr-2 text-sm text-neutral-content">copied</div>
41
- <Button
42
- ghost
43
- sm
44
- class="text-neutral-content hover:bg-secondary hover:text-secondary-content rounded-tl-none rounded-br-none rounded-tr-md rounded-bl-md"
45
- @click="() => copy(code)"
46
- >
47
- copy
48
- </Button>
49
- </div>
50
- <div class="lg:max-w-[calc(100vw-380px)]">
51
- <slot />
52
- </div>
53
- </div>
54
- </CodeWrapper>
55
- <slot v-else />
56
- </div>
57
- </template>
58
-
59
- <style>
60
- .code-wrapper pre code .line {
61
- display: block;
62
- min-height: 1rem;
63
- }
64
-
65
- .code-wrapper pre {
66
- max-width: calc(100vw - 3.5rem);
67
- }
68
- </style>
@@ -1,5 +0,0 @@
1
- <template>
2
- <strong>
3
- <slot />
4
- </strong>
5
- </template>
@@ -1,7 +0,0 @@
1
- <template>
2
- <div class="not-prose relative mb-10 mt-6 overflow-x-auto">
3
- <table class="table table-sm">
4
- <slot />
5
- </table>
6
- </div>
7
- </template>
@@ -1,5 +0,0 @@
1
- <template>
2
- <tbody>
3
- <slot />
4
- </tbody>
5
- </template>
@@ -1,5 +0,0 @@
1
- <template>
2
- <td>
3
- <slot />
4
- </td>
5
- </template>
@@ -1,5 +0,0 @@
1
- <template>
2
- <th>
3
- <slot />
4
- </th>
5
- </template>
@@ -1,5 +0,0 @@
1
- <template>
2
- <thead>
3
- <slot />
4
- </thead>
5
- </template>
@@ -1,5 +0,0 @@
1
- <template>
2
- <tr class="hover">
3
- <slot />
4
- </tr>
5
- </template>
@@ -1,5 +0,0 @@
1
- <template>
2
- <ul>
3
- <slot />
4
- </ul>
5
- </template>
@@ -1,171 +0,0 @@
1
- <script setup lang="ts">
2
- import { onKeyStroke, useFocus, useMagicKeys } from '@vueuse/core'
3
- import { useFuse } from '@vueuse/integrations/useFuse'
4
- import { computed, ref, watch } from 'vue'
5
-
6
- const search = ref('')
7
- const { allLinks } = useNav()
8
- const tags = allLinks.flatMap(item => item.tags)
9
- const matchingTag = computed(() => {
10
- if (search.value.length < 2) {
11
- return null
12
- }
13
- return tags.find(tag => tag.toLowerCase().startsWith(search.value.toLowerCase()))
14
- })
15
-
16
- // search results and popular results
17
- const { results } = useFuse(search, allLinks, {
18
- fuseOptions: { keys: ['label', 'tags'], includeScore: true, distance: 3 },
19
- resultLimit: 12,
20
- })
21
- const defaultResults = ['Button', 'Menu', 'Drawer', 'Tabs', 'Dropdown']
22
- .map(label => allLinks.find(item => item.label === label)!)
23
- .map(item => ({ item }))
24
- const eitherResults = computed(() => {
25
- if (results.value.length === 0) {
26
- return defaultResults
27
- }
28
- return results.value
29
- })
30
-
31
- // Open menu when searchbox is focused
32
- const isMenuOpen = ref(false)
33
- const searchbox = ref()
34
- const { focused } = useFocus(searchbox)
35
- watch(focused, val => {
36
- if (val) {
37
- isMenuOpen.value = val
38
- } else {
39
- setTimeout(() => {
40
- isMenuOpen.value = val
41
- }, 100)
42
- }
43
- })
44
-
45
- // track the highlighted index in the list
46
- const highlightedIndex = ref(0)
47
- const highlightedItem = computed(() => {
48
- return eitherResults.value[highlightedIndex.value]?.item
49
- })
50
- // when results change, reset the highlighted index
51
- watch(eitherResults, () => {
52
- highlightedIndex.value = 0
53
- })
54
-
55
- // meta|ctrl+k --> focus the searchbox
56
- const { meta, control } = useMagicKeys()
57
- onKeyStroke('k', () => {
58
- if (meta?.value || control?.value) {
59
- focused.value = !focused.value
60
- }
61
- })
62
-
63
- // escape --> close the list
64
- onKeyStroke('Escape', () => {
65
- if (focused.value) {
66
- if (search.value === '') {
67
- focused.value = false
68
- } else {
69
- search.value = ''
70
- highlightedIndex.value = 0
71
- }
72
- }
73
- })
74
-
75
- // menu click --> close the list
76
- function handleMenuClick() {
77
- focused.value = false
78
- }
79
-
80
- // enter --> navigate to highlighted item
81
- function handleEnter() {
82
- if (highlightedItem.value) {
83
- navigateTo(highlightedItem.value.to)
84
- focused.value = false
85
- isMenuOpen.value = false
86
- }
87
- }
88
-
89
- // arrow up --> highlighted previous item
90
- function handleArrowUp() {
91
- highlightedIndex.value = Math.max(highlightedIndex.value - 1, 0)
92
- }
93
- // arrow down --> highlight next item
94
- function handleArrowDown() {
95
- highlightedIndex.value = Math.min(highlightedIndex.value + 1, eitherResults.value.length - 1)
96
- }
97
- </script>
98
-
99
- <template>
100
- <Dropdown v-model:open="isMenuOpen" :auto-focus="false">
101
- <DropdownTarget class="relative inline-block">
102
- <Flex class="absolute z-10 top-0 bottom-0 pointer-events-none items-center pl-2">
103
- <Icon name="heroicons-solid:search" class="w-5 h-5 opacity-60" aria-hidden="true" />
104
- </Flex>
105
- <Input
106
- id="searchbox"
107
- ref="searchbox"
108
- v-model="search"
109
- placeholder="Search"
110
- name="search"
111
- bordered
112
- class="join-item max-w-[150px] md:max-w-none rounded-xl pl-8"
113
- onfocus="this.select()"
114
- @keypress.enter="handleEnter"
115
- @keydown.arrow-up="handleArrowUp"
116
- @keydown.arrow-down="handleArrowDown"
117
- />
118
- <Flex
119
- v-if="!focused"
120
- row
121
- class="hidden lg:flex items-center flex-nowrap absolute top-0 bottom-0 right-0 pr-2 pointer-events-none opacity-60"
122
- >
123
- <Kbd xs>cmd</Kbd>
124
- <Text xs class="relative bottom-px"> + </Text>
125
- <Kbd xs>k</Kbd>
126
- </Flex>
127
- </DropdownTarget>
128
- <DropdownContent
129
- class="bg-base-100 shadow-xl rounded-xl border border-base-300 mt-2 w-full overflow-y-auto max-h-[75vh]"
130
- @click="handleMenuClick"
131
- >
132
- <template #default="{ close }">
133
- <Menu>
134
- <MenuTitle v-if="!search.length"> Popular Components </MenuTitle>
135
- <MenuTitle v-if="search.length && results.length"> Search Results </MenuTitle>
136
-
137
- <MenuItem v-if="search.length && !results.length">
138
- <span>No Results Found</span>
139
- </MenuItem>
140
- <template v-else-if="search.length">
141
- <MenuItem v-for="(result, index) in results" :key="result.item.label" :active="index === highlightedIndex">
142
- <NuxtLink :to="result.item.to" @click="close">
143
- <Icon
144
- v-if="(result.item as any).icon"
145
- :name="(result.item as any).icon"
146
- class="w-5 h-5"
147
- aria-hidden="true"
148
- />
149
- {{ result.item.label }}
150
- <Badge v-if="matchingTag && result.item.tags.includes(matchingTag)" warning sm>
151
- {{ matchingTag }}
152
- </Badge>
153
- </NuxtLink>
154
- </MenuItem>
155
- </template>
156
- <template v-else>
157
- <MenuItem
158
- v-for="(result, index) in defaultResults"
159
- :key="result.item.label"
160
- :active="index === highlightedIndex"
161
- >
162
- <NuxtLink :to="result.item.to" @click="close">
163
- {{ result.item.label }}
164
- </NuxtLink>
165
- </MenuItem>
166
- </template>
167
- </Menu>
168
- </template>
169
- </DropdownContent>
170
- </Dropdown>
171
- </template>
@@ -1,14 +0,0 @@
1
- <script setup lang="ts">
2
- const { openSearch } = useSearch()
3
- </script>
4
-
5
- <template>
6
- <button
7
- class="input input-ghost hover:bg-base-200 focus-visible:bg-base-200 cursor-pointer transition-colors focus:outline-none flex items-center gap-2"
8
- @click="openSearch"
9
- >
10
- <Icon name="heroicons-solid:search" class="size-4 shrink-0 opacity-60" />
11
- <span class="grow text-left hidden sm:inline">Search...</span>
12
- <Kbd sm class="hidden lg:inline-flex opacity-50"> <span class="me-1 text-sm">⌘</span>K </Kbd>
13
- </button>
14
- </template>