daisy-ui-kit 5.0.0-pre.8 → 5.0.0
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/app/components/Accordion.vue +8 -5
- package/app/components/Alert.vue +2 -1
- package/app/components/Avatar.vue +10 -7
- package/app/components/AvatarGroup.vue +6 -2
- package/app/components/Badge.vue +19 -1
- package/app/components/Button.vue +67 -45
- package/app/components/Calendar.vue +151 -42
- package/app/components/CalendarInput.vue +229 -130
- package/app/components/CalendarSkeleton.vue +51 -10
- package/app/components/Card.vue +20 -2
- package/app/components/CardActions.vue +1 -1
- package/app/components/CardBody.vue +1 -1
- package/app/components/CardTitle.vue +1 -1
- package/app/components/Carousel.vue +2 -1
- package/app/components/Chat.vue +6 -1
- package/app/components/Checkbox.vue +1 -1
- package/app/components/Collapse.vue +38 -5
- package/app/components/CollapseTitle.vue +11 -1
- package/app/components/Countdown.vue +3 -3
- package/app/components/CountdownTimers.vue +4 -7
- package/app/components/Counter.vue +14 -3
- package/app/components/DaisyLink.vue +33 -15
- package/app/components/Dock.vue +5 -6
- package/app/components/DockItem.vue +5 -3
- package/app/components/Drawer.vue +15 -12
- package/app/components/DrawerContent.vue +9 -6
- package/app/components/DrawerSide.vue +9 -6
- package/app/components/Dropdown.vue +61 -50
- package/app/components/DropdownButton.vue +11 -4
- package/app/components/DropdownContent.vue +90 -20
- package/app/components/DropdownTarget.vue +10 -3
- package/app/components/Fab.vue +16 -0
- package/app/components/FabClose.vue +18 -0
- package/app/components/FabMainAction.vue +5 -0
- package/app/components/FabTrigger.vue +117 -0
- package/app/components/Fieldset.vue +5 -4
- package/app/components/FileInput.vue +1 -1
- package/app/components/Filter.vue +45 -38
- package/app/components/Flex.vue +8 -1
- package/app/components/FlexItem.vue +30 -27
- package/app/components/Footer.vue +16 -12
- package/app/components/FooterTitle.vue +8 -5
- package/app/components/Hero.vue +9 -6
- package/app/components/HeroContent.vue +9 -6
- package/app/components/Hover3D.vue +22 -0
- package/app/components/HoverGallery.vue +11 -0
- package/app/components/Indicator.vue +12 -5
- package/app/components/IndicatorItem.vue +21 -14
- package/app/components/Input.vue +44 -47
- package/app/components/Kbd.vue +2 -1
- package/app/components/Label.vue +32 -29
- package/app/components/MenuExpand.vue +5 -13
- package/app/components/MenuExpandToggle.vue +7 -1
- package/app/components/MenuItem.vue +6 -4
- package/app/components/Modal.vue +23 -17
- package/app/components/Progress.vue +13 -1
- package/app/components/Prose.vue +7 -2
- package/app/components/RadialProgress.vue +8 -8
- package/app/components/Radio.vue +1 -1
- package/app/components/RadioGroup.vue +2 -2
- package/app/components/Range.vue +186 -46
- package/app/components/RangeMeasure.vue +33 -30
- package/app/components/RangeMeasureTick.vue +4 -5
- package/app/components/Rating.vue +70 -53
- package/app/components/Select.vue +44 -47
- package/app/components/SkeletonText.vue +11 -0
- package/app/components/Stack.vue +5 -0
- package/app/components/Steps.vue +7 -2
- package/app/components/Swap.vue +4 -10
- package/app/components/Tab.vue +23 -5
- package/app/components/Text.vue +47 -23
- package/app/components/TextArea.vue +75 -30
- package/app/components/TextRotate.vue +24 -0
- package/app/components/ThemeController.vue +3 -4
- package/app/components/ThemeProvider.vue +47 -32
- package/app/components/TimelineLine.vue +1 -1
- package/app/components/TimelineStart.vue +2 -1
- package/app/components/Toast.vue +46 -8
- package/app/components/Toggle.vue +2 -2
- package/app/components/Tooltip.vue +111 -21
- package/app/components/TooltipContent.vue +279 -1
- package/app/components/TooltipTarget.vue +20 -0
- package/app/composables/__tests__/use-calendar.test.ts +239 -0
- package/app/composables/use-calendar.ts +288 -0
- package/app/composables/use-daisy-theme.ts +140 -0
- package/app/composables/use-toast.ts +345 -0
- package/app/composables/useSearch.ts +22 -0
- package/app/utils/drawer-utils.ts +15 -13
- package/app/utils/position-area.ts +40 -0
- package/nuxt.d.ts +13 -0
- package/nuxt.js +12 -9
- package/package.json +52 -27
- package/app/utils/random-string.ts +0 -19
package/app/components/Input.vue
CHANGED
|
@@ -1,36 +1,49 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import {
|
|
3
|
-
import { computed, inject, ref } from 'vue'
|
|
2
|
+
import { computed, inject } from 'vue'
|
|
4
3
|
|
|
5
4
|
// Map input type to value type
|
|
6
5
|
type InputType =
|
|
7
|
-
| 'text'
|
|
6
|
+
| 'text'
|
|
7
|
+
| 'password'
|
|
8
|
+
| 'email'
|
|
9
|
+
| 'number'
|
|
10
|
+
| 'date'
|
|
11
|
+
| 'datetime-local'
|
|
12
|
+
| 'week'
|
|
13
|
+
| 'month'
|
|
14
|
+
| 'tel'
|
|
15
|
+
| 'url'
|
|
16
|
+
| 'search'
|
|
17
|
+
| 'time'
|
|
8
18
|
|
|
9
|
-
const props = withDefaults(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
19
|
+
const props = withDefaults(
|
|
20
|
+
defineProps<{
|
|
21
|
+
modelValue?: string | number | null
|
|
22
|
+
type?: InputType
|
|
23
|
+
placeholder?: string
|
|
24
|
+
disabled?: boolean
|
|
25
|
+
validator?: boolean
|
|
26
|
+
join?: boolean
|
|
27
|
+
color?: string
|
|
28
|
+
primary?: boolean
|
|
29
|
+
secondary?: boolean
|
|
30
|
+
accent?: boolean
|
|
31
|
+
info?: boolean
|
|
32
|
+
success?: boolean
|
|
33
|
+
warning?: boolean
|
|
34
|
+
error?: boolean
|
|
35
|
+
ghost?: boolean
|
|
36
|
+
size?: 'xl' | 'lg' | 'md' | 'sm' | 'xs'
|
|
37
|
+
xl?: boolean
|
|
38
|
+
lg?: boolean
|
|
39
|
+
md?: boolean
|
|
40
|
+
sm?: boolean
|
|
41
|
+
xs?: boolean
|
|
42
|
+
}>(),
|
|
43
|
+
{
|
|
44
|
+
type: 'text',
|
|
45
|
+
},
|
|
46
|
+
)
|
|
34
47
|
const emit = defineEmits(['update:modelValue'])
|
|
35
48
|
|
|
36
49
|
// For slot context
|
|
@@ -38,28 +51,17 @@ function setValue(val: string | number | null) {
|
|
|
38
51
|
emit('update:modelValue', val)
|
|
39
52
|
}
|
|
40
53
|
|
|
41
|
-
const labelCtx = inject('labelCtx')
|
|
54
|
+
const labelCtx = inject('labelCtx', null)
|
|
42
55
|
|
|
43
56
|
function handleInput(event: Event) {
|
|
44
57
|
let val: string | number | null
|
|
45
58
|
if (props.type === 'number') {
|
|
46
59
|
const inputVal = (event.target as HTMLInputElement).value
|
|
47
60
|
val = inputVal === '' ? null : Number(inputVal)
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
61
|
+
} else {
|
|
50
62
|
val = (event.target as HTMLInputElement).value
|
|
51
63
|
}
|
|
52
64
|
emit('update:modelValue', val)
|
|
53
|
-
|
|
54
|
-
// Sync checked only on input if it's a checkbox
|
|
55
|
-
if (
|
|
56
|
-
props.type === 'checkbox'
|
|
57
|
-
&& labelCtx
|
|
58
|
-
&& Object.prototype.hasOwnProperty.call(labelCtx, 'checked')
|
|
59
|
-
&& typeof labelCtx.checked.value === 'boolean'
|
|
60
|
-
) {
|
|
61
|
-
labelCtx.checked.value = Boolean(event.target.checked)
|
|
62
|
-
}
|
|
63
65
|
}
|
|
64
66
|
|
|
65
67
|
const inputAttrs = computed(() => {
|
|
@@ -110,10 +112,5 @@ const inputModel = computed({
|
|
|
110
112
|
:input-model="inputModel"
|
|
111
113
|
/>
|
|
112
114
|
</div>
|
|
113
|
-
<input
|
|
114
|
-
v-else
|
|
115
|
-
v-bind="inputAttrs"
|
|
116
|
-
:value="inputModel"
|
|
117
|
-
@input="handleInput"
|
|
118
|
-
>
|
|
115
|
+
<input v-else v-bind="inputAttrs" :value="inputModel" @input="handleInput" />
|
|
119
116
|
</template>
|
package/app/components/Kbd.vue
CHANGED
package/app/components/Label.vue
CHANGED
|
@@ -2,34 +2,37 @@
|
|
|
2
2
|
import { provide, ref } from 'vue'
|
|
3
3
|
import Text from './Text.vue'
|
|
4
4
|
|
|
5
|
-
withDefaults(
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
withDefaults(
|
|
6
|
+
defineProps<{
|
|
7
|
+
is?: string
|
|
8
|
+
floating?: boolean
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
input?: boolean
|
|
11
|
+
select?: boolean
|
|
12
|
+
toggle?: boolean
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}>(),
|
|
31
|
-
|
|
32
|
-
|
|
14
|
+
join?: boolean
|
|
15
|
+
color?: string
|
|
16
|
+
neutral?: boolean
|
|
17
|
+
primary?: boolean
|
|
18
|
+
secondary?: boolean
|
|
19
|
+
accent?: boolean
|
|
20
|
+
info?: boolean
|
|
21
|
+
success?: boolean
|
|
22
|
+
warning?: boolean
|
|
23
|
+
error?: boolean
|
|
24
|
+
ghost?: boolean
|
|
25
|
+
size?: 'xl' | 'lg' | 'md' | 'sm' | 'xs'
|
|
26
|
+
xl?: boolean
|
|
27
|
+
lg?: boolean
|
|
28
|
+
md?: boolean
|
|
29
|
+
sm?: boolean
|
|
30
|
+
xs?: boolean
|
|
31
|
+
}>(),
|
|
32
|
+
{
|
|
33
|
+
is: 'label',
|
|
34
|
+
},
|
|
35
|
+
)
|
|
33
36
|
|
|
34
37
|
// Provide label context for child inputs
|
|
35
38
|
const checked = ref(false)
|
|
@@ -41,9 +44,9 @@ provide('labelCtx', { checked })
|
|
|
41
44
|
:is="is"
|
|
42
45
|
:class="[
|
|
43
46
|
{
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
+
input,
|
|
48
|
+
select,
|
|
49
|
+
toggle,
|
|
47
50
|
'join-item': (input || select || toggle) && join,
|
|
48
51
|
'input-neutral': input && (neutral || color === 'neutral'),
|
|
49
52
|
'input-primary': input && (primary || color === 'primary'),
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
import type { Ref } from 'vue'
|
|
3
3
|
|
|
4
4
|
import { onClickOutside, useElementHover } from '@vueuse/core'
|
|
5
|
-
import { onMounted, provide, ref } from 'vue'
|
|
6
|
-
import { randomString } from '../utils/random-string'
|
|
5
|
+
import { onMounted, provide, ref, useId } from 'vue'
|
|
7
6
|
|
|
8
7
|
// Define the MenuExpandState interface
|
|
9
8
|
export interface MenuExpandState {
|
|
@@ -16,12 +15,10 @@ export interface MenuExpandState {
|
|
|
16
15
|
|
|
17
16
|
// Props with defaults
|
|
18
17
|
const {
|
|
19
|
-
randomId = randomString(12),
|
|
20
18
|
hover = false,
|
|
21
19
|
delayLeave = 300,
|
|
22
20
|
closeOnClickOutside = false,
|
|
23
21
|
} = defineProps<{
|
|
24
|
-
randomId?: string
|
|
25
22
|
hover?: boolean
|
|
26
23
|
delayLeave?: number
|
|
27
24
|
closeOnClickOutside?: boolean
|
|
@@ -31,8 +28,9 @@ const {
|
|
|
31
28
|
const isOpen = defineModel('open', { default: false, type: Boolean })
|
|
32
29
|
|
|
33
30
|
// Generate IDs for accessibility and targeting
|
|
34
|
-
const
|
|
35
|
-
const
|
|
31
|
+
const uniqueId = useId()
|
|
32
|
+
const wrapperId = `expand-wrapper-${uniqueId}`
|
|
33
|
+
const id = `expand-${uniqueId}`
|
|
36
34
|
|
|
37
35
|
// Element reference for click outside detection
|
|
38
36
|
const expandEl = ref()
|
|
@@ -88,13 +86,7 @@ function handleClick(_ev: MouseEvent) {}
|
|
|
88
86
|
</script>
|
|
89
87
|
|
|
90
88
|
<template>
|
|
91
|
-
<details
|
|
92
|
-
:id="wrapperId"
|
|
93
|
-
ref="expandEl"
|
|
94
|
-
class="dropdown menu-expand"
|
|
95
|
-
:open="isOpen"
|
|
96
|
-
@click="handleClick"
|
|
97
|
-
>
|
|
89
|
+
<details :id="wrapperId" ref="expandEl" class="dropdown menu-expand" :open="isOpen" @click="handleClick">
|
|
98
90
|
<slot v-bind="{ toggle, open, close }" />
|
|
99
91
|
</details>
|
|
100
92
|
</template>
|
|
@@ -8,7 +8,13 @@ const { id, isOpen, toggle } = menuExpandState || {}
|
|
|
8
8
|
</script>
|
|
9
9
|
|
|
10
10
|
<template>
|
|
11
|
-
<summary
|
|
11
|
+
<summary
|
|
12
|
+
:id="id"
|
|
13
|
+
:aria-expanded="isOpen"
|
|
14
|
+
aria-haspopup="menu"
|
|
15
|
+
class="menu-expand-toggle"
|
|
16
|
+
@click.prevent.stop="toggle"
|
|
17
|
+
>
|
|
12
18
|
<slot />
|
|
13
19
|
</summary>
|
|
14
20
|
</template>
|
|
@@ -15,12 +15,14 @@ defineProps<{
|
|
|
15
15
|
Allow adding .active class to the MenuItem element.
|
|
16
16
|
DaisyUI only supports adding it to the `a` element.
|
|
17
17
|
*/
|
|
18
|
-
.menu-item.menu-active > a,
|
|
18
|
+
.menu-item.menu-active > a,
|
|
19
|
+
.menu-item.menu-active > span {
|
|
19
20
|
background-color: hsl(var(--n) / var(--tw-bg-opacity));
|
|
20
21
|
color: hsl(var(--nc) / var(--tw-text-opacity));
|
|
21
22
|
}
|
|
22
|
-
.menu-item.menu-disabled > a,
|
|
23
|
-
|
|
23
|
+
.menu-item.menu-disabled > a,
|
|
24
|
+
.menu-item.menu-disabled > span {
|
|
25
|
+
background-color: var(--n);
|
|
24
26
|
}
|
|
25
27
|
|
|
26
28
|
/* Fix padding when putting a Dropdown inside of a menu */
|
|
@@ -32,6 +34,6 @@ defineProps<{
|
|
|
32
34
|
padding-left: 1rem;
|
|
33
35
|
padding-right: 1rem;
|
|
34
36
|
padding-top: 0.5rem;
|
|
35
|
-
padding-bottom: 0.5rem
|
|
37
|
+
padding-bottom: 0.5rem;
|
|
36
38
|
}
|
|
37
39
|
</style>
|
package/app/components/Modal.vue
CHANGED
|
@@ -1,29 +1,35 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { computed, ref, watch } from 'vue'
|
|
2
|
+
import { computed, ref, watch } from 'vue'
|
|
3
3
|
|
|
4
|
-
const props = withDefaults(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
4
|
+
const props = withDefaults(
|
|
5
|
+
defineProps<{
|
|
6
|
+
modelValue?: boolean
|
|
7
|
+
closeOnClickOutside?: boolean
|
|
8
|
+
placement?: 'top' | 'bottom' | 'start' | 'end'
|
|
9
|
+
top?: boolean
|
|
10
|
+
bottom?: boolean
|
|
11
|
+
start?: boolean
|
|
12
|
+
end?: boolean
|
|
13
|
+
}>(),
|
|
14
|
+
{
|
|
15
|
+
closeOnClickOutside: true,
|
|
16
|
+
},
|
|
17
|
+
)
|
|
15
18
|
const emit = defineEmits(['update:modelValue'])
|
|
16
19
|
|
|
17
20
|
const is = 'div'
|
|
18
21
|
|
|
19
22
|
// defineModel 'open'
|
|
20
23
|
const _isOpen = ref(props.modelValue)
|
|
21
|
-
watch(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
watch(
|
|
25
|
+
() => props.modelValue,
|
|
26
|
+
val => {
|
|
27
|
+
_isOpen.value = val
|
|
28
|
+
},
|
|
29
|
+
)
|
|
24
30
|
const isOpen = computed({
|
|
25
31
|
get: () => _isOpen.value,
|
|
26
|
-
set:
|
|
32
|
+
set: val => {
|
|
27
33
|
_isOpen.value = val
|
|
28
34
|
if (props.modelValue !== val) {
|
|
29
35
|
emit('update:modelValue', val)
|
|
@@ -39,7 +45,7 @@ function handleClick() {
|
|
|
39
45
|
</script>
|
|
40
46
|
|
|
41
47
|
<template>
|
|
42
|
-
<input v-model="isOpen" type="checkbox" class="modal-toggle"
|
|
48
|
+
<input v-model="isOpen" type="checkbox" class="modal-toggle" />
|
|
43
49
|
<Component
|
|
44
50
|
:is="is"
|
|
45
51
|
v-bind="{ ...$attrs, ...$props }"
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
const {
|
|
2
|
+
const {
|
|
3
|
+
value = 0,
|
|
4
|
+
max = 100,
|
|
5
|
+
color,
|
|
6
|
+
neutral,
|
|
7
|
+
primary,
|
|
8
|
+
secondary,
|
|
9
|
+
accent,
|
|
10
|
+
success,
|
|
11
|
+
info,
|
|
12
|
+
warning,
|
|
13
|
+
error,
|
|
14
|
+
} = defineProps<{
|
|
3
15
|
value?: string | number
|
|
4
16
|
max?: string | number
|
|
5
17
|
|
package/app/components/Prose.vue
CHANGED
|
@@ -25,8 +25,13 @@
|
|
|
25
25
|
@apply text-accent;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
.prose h1 a,
|
|
28
|
+
.prose h1 a,
|
|
29
|
+
.prose h2 a,
|
|
30
|
+
.prose h3 a,
|
|
31
|
+
.prose h4 a,
|
|
32
|
+
.prose h5 a,
|
|
33
|
+
.prose h6 a {
|
|
29
34
|
text-decoration: none;
|
|
30
|
-
@apply font-bold
|
|
35
|
+
@apply font-bold;
|
|
31
36
|
}
|
|
32
37
|
</style>
|
|
@@ -20,14 +20,14 @@ defineProps<{
|
|
|
20
20
|
<div
|
|
21
21
|
class="radial-progress"
|
|
22
22
|
:class="{
|
|
23
|
-
'text-neutral':
|
|
24
|
-
'text-primary':
|
|
25
|
-
'text-secondary':
|
|
26
|
-
'text-accent':
|
|
27
|
-
'text-info':
|
|
28
|
-
'text-success':
|
|
29
|
-
'text-warning':
|
|
30
|
-
'text-error':
|
|
23
|
+
'text-neutral': neutral || color === 'neutral',
|
|
24
|
+
'text-primary': primary || color === 'primary',
|
|
25
|
+
'text-secondary': secondary || color === 'secondary',
|
|
26
|
+
'text-accent': accent || color === 'accent',
|
|
27
|
+
'text-info': info || color === 'info',
|
|
28
|
+
'text-success': success || color === 'success',
|
|
29
|
+
'text-warning': warning || color === 'warning',
|
|
30
|
+
'text-error': error || color === 'error',
|
|
31
31
|
}"
|
|
32
32
|
:style="`--value:${value}; --size:${size || '4rem'}; --thickness:${thickness || 'calc(var(--size) / 10)'};`"
|
|
33
33
|
>
|
package/app/components/Radio.vue
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { computed, provide, reactive } from 'vue'
|
|
2
|
+
import { computed, provide, reactive } from 'vue'
|
|
3
3
|
|
|
4
4
|
const props = defineProps<{
|
|
5
5
|
modelValue?: any
|
|
@@ -28,7 +28,7 @@ const currentValue = computed({
|
|
|
28
28
|
get: () => {
|
|
29
29
|
return props.modelValue
|
|
30
30
|
},
|
|
31
|
-
set:
|
|
31
|
+
set: val => {
|
|
32
32
|
emit('update:modelValue', val)
|
|
33
33
|
},
|
|
34
34
|
})
|