daisy-ui-kit 5.0.0-pre.9 → 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.
Files changed (93) hide show
  1. package/app/components/Accordion.vue +8 -5
  2. package/app/components/Alert.vue +2 -1
  3. package/app/components/Avatar.vue +10 -7
  4. package/app/components/AvatarGroup.vue +6 -2
  5. package/app/components/Badge.vue +19 -1
  6. package/app/components/Button.vue +66 -46
  7. package/app/components/Calendar.vue +151 -42
  8. package/app/components/CalendarInput.vue +229 -130
  9. package/app/components/CalendarSkeleton.vue +51 -10
  10. package/app/components/Card.vue +20 -2
  11. package/app/components/CardActions.vue +1 -1
  12. package/app/components/CardBody.vue +1 -1
  13. package/app/components/CardTitle.vue +1 -1
  14. package/app/components/Carousel.vue +2 -1
  15. package/app/components/Chat.vue +6 -1
  16. package/app/components/Checkbox.vue +1 -1
  17. package/app/components/Collapse.vue +38 -5
  18. package/app/components/CollapseTitle.vue +11 -1
  19. package/app/components/Countdown.vue +3 -3
  20. package/app/components/CountdownTimers.vue +4 -7
  21. package/app/components/Counter.vue +14 -3
  22. package/app/components/DaisyLink.vue +33 -15
  23. package/app/components/Dock.vue +5 -6
  24. package/app/components/DockItem.vue +5 -3
  25. package/app/components/Drawer.vue +15 -12
  26. package/app/components/DrawerContent.vue +9 -6
  27. package/app/components/DrawerSide.vue +9 -6
  28. package/app/components/Dropdown.vue +61 -50
  29. package/app/components/DropdownButton.vue +11 -4
  30. package/app/components/DropdownContent.vue +90 -20
  31. package/app/components/DropdownTarget.vue +10 -3
  32. package/app/components/Fab.vue +16 -0
  33. package/app/components/FabClose.vue +18 -0
  34. package/app/components/FabMainAction.vue +5 -0
  35. package/app/components/FabTrigger.vue +117 -0
  36. package/app/components/Fieldset.vue +5 -4
  37. package/app/components/FileInput.vue +1 -1
  38. package/app/components/Filter.vue +45 -38
  39. package/app/components/Flex.vue +8 -1
  40. package/app/components/FlexItem.vue +30 -27
  41. package/app/components/Footer.vue +16 -12
  42. package/app/components/FooterTitle.vue +8 -5
  43. package/app/components/Hero.vue +9 -6
  44. package/app/components/HeroContent.vue +9 -6
  45. package/app/components/Hover3D.vue +22 -0
  46. package/app/components/HoverGallery.vue +11 -0
  47. package/app/components/Indicator.vue +12 -5
  48. package/app/components/IndicatorItem.vue +21 -14
  49. package/app/components/Input.vue +44 -47
  50. package/app/components/Kbd.vue +2 -1
  51. package/app/components/Label.vue +32 -29
  52. package/app/components/MenuExpand.vue +5 -13
  53. package/app/components/MenuExpandToggle.vue +7 -1
  54. package/app/components/MenuItem.vue +6 -4
  55. package/app/components/Modal.vue +23 -17
  56. package/app/components/Progress.vue +13 -1
  57. package/app/components/Prose.vue +7 -2
  58. package/app/components/RadialProgress.vue +8 -8
  59. package/app/components/Radio.vue +1 -1
  60. package/app/components/RadioGroup.vue +2 -2
  61. package/app/components/Range.vue +186 -46
  62. package/app/components/RangeMeasure.vue +33 -30
  63. package/app/components/RangeMeasureTick.vue +4 -5
  64. package/app/components/Rating.vue +70 -53
  65. package/app/components/Select.vue +44 -47
  66. package/app/components/SkeletonText.vue +11 -0
  67. package/app/components/Stack.vue +5 -0
  68. package/app/components/Steps.vue +7 -2
  69. package/app/components/Swap.vue +4 -10
  70. package/app/components/Tab.vue +23 -5
  71. package/app/components/Text.vue +47 -23
  72. package/app/components/TextArea.vue +75 -30
  73. package/app/components/TextRotate.vue +24 -0
  74. package/app/components/ThemeController.vue +3 -4
  75. package/app/components/ThemeProvider.vue +47 -32
  76. package/app/components/TimelineLine.vue +1 -1
  77. package/app/components/TimelineStart.vue +2 -1
  78. package/app/components/Toast.vue +3 -8
  79. package/app/components/Toggle.vue +2 -2
  80. package/app/components/Tooltip.vue +111 -21
  81. package/app/components/TooltipContent.vue +279 -1
  82. package/app/components/TooltipTarget.vue +20 -0
  83. package/app/composables/__tests__/use-calendar.test.ts +239 -0
  84. package/app/composables/use-calendar.ts +288 -0
  85. package/app/composables/use-daisy-theme.ts +140 -0
  86. package/app/composables/use-toast.ts +345 -0
  87. package/app/composables/useSearch.ts +22 -0
  88. package/app/utils/drawer-utils.ts +15 -13
  89. package/app/utils/position-area.ts +40 -0
  90. package/nuxt.d.ts +13 -0
  91. package/nuxt.js +12 -9
  92. package/package.json +40 -29
  93. package/app/utils/random-string.ts +0 -19
@@ -0,0 +1,117 @@
1
+ <script setup lang="ts">
2
+ defineOptions({
3
+ inheritAttrs: false,
4
+ })
5
+
6
+ const props = withDefaults(
7
+ defineProps<{
8
+ btn?: boolean
9
+ join?: boolean
10
+ close?: boolean
11
+
12
+ color?: string
13
+ neutral?: boolean
14
+ primary?: boolean
15
+ secondary?: boolean
16
+ accent?: boolean
17
+ info?: boolean
18
+ success?: boolean
19
+ warning?: boolean
20
+ error?: boolean
21
+
22
+ ghost?: boolean
23
+ link?: boolean
24
+ glass?: boolean
25
+ outline?: boolean
26
+ dash?: boolean
27
+ soft?: boolean
28
+
29
+ shape?: 'circle' | 'square' | 'wide' | 'block'
30
+ circle?: boolean
31
+ square?: boolean
32
+ wide?: boolean
33
+ block?: boolean
34
+
35
+ noAnimation?: boolean
36
+ active?: boolean
37
+
38
+ size?: 'lg' | 'md' | 'sm' | 'xs' | 'xl'
39
+ xl?: boolean
40
+ lg?: boolean
41
+ md?: boolean
42
+ sm?: boolean
43
+ xs?: boolean
44
+ }>(),
45
+ {
46
+ btn: true,
47
+ },
48
+ )
49
+
50
+ function handleMouseDown(event: MouseEvent) {
51
+ if (!props.close) return
52
+ const fab = (event.currentTarget as HTMLElement)?.closest('.fab')
53
+ // Only close if FAB is already open (has focus within)
54
+ if (fab instanceof HTMLElement && fab.matches(':focus-within')) {
55
+ event.preventDefault()
56
+ fab.blur()
57
+ if (document.activeElement instanceof HTMLElement) {
58
+ document.activeElement.blur()
59
+ }
60
+ }
61
+ }
62
+ </script>
63
+
64
+ <template>
65
+ <div
66
+ tabindex="0"
67
+ role="button"
68
+ v-bind="$attrs"
69
+ :class="{
70
+ btn,
71
+ 'join-item': join,
72
+
73
+ 'btn-neutral': neutral || color === 'neutral',
74
+ 'btn-primary': primary || color === 'primary',
75
+ 'btn-secondary': secondary || color === 'secondary',
76
+ 'btn-accent': accent || color === 'accent',
77
+ 'btn-info': info || color === 'info',
78
+ 'btn-success': success || color === 'success',
79
+ 'btn-warning': warning || color === 'warning',
80
+ 'btn-error': error || color === 'error',
81
+
82
+ 'text-primary': (primary || color === 'primary') && link,
83
+ 'text-secondary': (secondary || color === 'secondary') && link,
84
+ 'text-neutral': (neutral || color === 'neutral') && link,
85
+ 'text-accent': (accent || color === 'accent') && link,
86
+ 'text-info': (info || color === 'info') && link,
87
+ 'text-success': (success || color === 'success') && link,
88
+ 'text-warning': (warning || color === 'warning') && link,
89
+ 'text-error': (error || color === 'error') && link,
90
+
91
+ glass,
92
+
93
+ 'btn-circle': circle || shape === 'circle',
94
+ 'btn-square': square || shape === 'square',
95
+ 'btn-wide': wide || shape === 'wide',
96
+ 'btn-block': block || shape === 'block',
97
+
98
+ 'btn-xl': xl || size === 'xl',
99
+ 'btn-lg': lg || size === 'lg',
100
+ 'btn-md': md || size === 'md',
101
+ 'btn-sm': sm || size === 'sm',
102
+ 'btn-xs': xs || size === 'xs',
103
+
104
+ 'btn-outline': outline,
105
+ 'btn-dash': dash,
106
+ 'btn-ghost': ghost,
107
+ 'btn-soft': soft,
108
+ 'btn-link': link,
109
+
110
+ 'no-animation': noAnimation,
111
+ 'btn-active': active,
112
+ }"
113
+ @mousedown="handleMouseDown"
114
+ >
115
+ <slot />
116
+ </div>
117
+ </template>
@@ -1,4 +1,8 @@
1
1
  <script setup lang="ts">
2
+ defineOptions({
3
+ inheritAttrs: false,
4
+ })
5
+
2
6
  const { is = 'fieldset', legend } = defineProps<{
3
7
  is?: string
4
8
  legend?: string
@@ -6,10 +10,7 @@ const { is = 'fieldset', legend } = defineProps<{
6
10
  </script>
7
11
 
8
12
  <template>
9
- <component
10
- :is="is"
11
- class="fieldset bg-base-200 border-base-300 rounded-box border p-4"
12
- >
13
+ <component :is="is" v-bind="$attrs" class="fieldset bg-base-200 border-base-300 rounded-box border p-4">
13
14
  <legend v-if="legend" class="fieldset-legend">
14
15
  {{ legend }}
15
16
  </legend>
@@ -49,5 +49,5 @@ defineEmits(['files'])
49
49
  'file-input-ghost': ghost,
50
50
  }"
51
51
  @input="$emit('files', ($event.target as any).value)"
52
- >
52
+ />
53
53
  </template>
@@ -1,6 +1,46 @@
1
1
  <script setup lang="ts">
2
2
  import { computed } from 'vue'
3
3
 
4
+ defineOptions({
5
+ inheritAttrs: false,
6
+ })
7
+
8
+ const props = withDefaults(
9
+ defineProps<{
10
+ is?: string
11
+ name: string
12
+ items: FilterItemInput[]
13
+ modelValue?: any
14
+ resetLabel?: string
15
+ position?: 'start' | 'end'
16
+ start?: boolean
17
+ end?: boolean
18
+
19
+ color?: string
20
+ neutral?: boolean
21
+ primary?: boolean
22
+ secondary?: boolean
23
+ accent?: boolean
24
+ info?: boolean
25
+ success?: boolean
26
+ warning?: boolean
27
+ error?: boolean
28
+
29
+ size?: 'xl' | 'lg' | 'md' | 'sm' | 'xs'
30
+ xl?: boolean
31
+ lg?: boolean
32
+ md?: boolean
33
+ sm?: boolean
34
+ xs?: boolean
35
+ }>(),
36
+ {
37
+ resetLabel: 'All',
38
+ is: 'div',
39
+ },
40
+ )
41
+
42
+ const emit = defineEmits(['update:modelValue'])
43
+
4
44
  interface FilterItem {
5
45
  label: string
6
46
  value: any
@@ -8,39 +48,6 @@ interface FilterItem {
8
48
 
9
49
  type FilterItemInput = string | FilterItem
10
50
 
11
- const props = withDefaults(defineProps<{
12
- is?: string
13
- name: string
14
- items: FilterItemInput[]
15
- modelValue?: any
16
- resetLabel?: string
17
- position?: 'start' | 'end'
18
- start?: boolean
19
- end?: boolean
20
-
21
- color?: string
22
- neutral?: boolean
23
- primary?: boolean
24
- secondary?: boolean
25
- accent?: boolean
26
- info?: boolean
27
- success?: boolean
28
- warning?: boolean
29
- error?: boolean
30
-
31
- size?: 'xl' | 'lg' | 'md' | 'sm' | 'xs'
32
- xl?: boolean
33
- lg?: boolean
34
- md?: boolean
35
- sm?: boolean
36
- xs?: boolean
37
- }>(), {
38
- resetLabel: 'All',
39
- is: 'div',
40
- })
41
-
42
- const emit = defineEmits(['update:modelValue'])
43
-
44
51
  const currentValue = computed({
45
52
  get: () => props.modelValue,
46
53
  set(val) {
@@ -49,7 +56,7 @@ const currentValue = computed({
49
56
  })
50
57
 
51
58
  const normalizedItems = computed(() => {
52
- return props.items.map((item) => {
59
+ return props.items.map(item => {
53
60
  if (typeof item === 'string') {
54
61
  return { label: item, value: item }
55
62
  }
@@ -59,7 +66,7 @@ const normalizedItems = computed(() => {
59
66
  </script>
60
67
 
61
68
  <template>
62
- <component :is="props.is" class="filter">
69
+ <component :is="props.is" v-bind="$attrs" class="filter">
63
70
  <!-- Reset button at start -->
64
71
  <input
65
72
  v-if="resetLabel && (start || position === 'start')"
@@ -76,7 +83,7 @@ const normalizedItems = computed(() => {
76
83
  :name="name"
77
84
  :aria-label="resetLabel"
78
85
  :value="null"
79
- >
86
+ />
80
87
 
81
88
  <!-- Filter items -->
82
89
  <template v-for="(item, index) in normalizedItems" :key="index">
@@ -102,7 +109,7 @@ const normalizedItems = computed(() => {
102
109
  :name="name"
103
110
  :aria-label="item.label"
104
111
  :value="item.value"
105
- >
112
+ />
106
113
  </template>
107
114
 
108
115
  <!-- Reset button at end -->
@@ -114,7 +121,7 @@ const normalizedItems = computed(() => {
114
121
  :name="name"
115
122
  :aria-label="resetLabel"
116
123
  :value="null"
117
- >
124
+ />
118
125
 
119
126
  <!-- Optional slot for custom items -->
120
127
  <slot />
@@ -1,4 +1,8 @@
1
1
  <script setup lang="ts">
2
+ defineOptions({
3
+ inheritAttrs: false,
4
+ })
5
+
2
6
  const { is = 'div', ...props } = defineProps<{
3
7
  is?: string | object
4
8
  join?: boolean
@@ -44,7 +48,10 @@ const { is = 'div', ...props } = defineProps<{
44
48
 
45
49
  <template>
46
50
  <component
47
- :is="is" class="flex" :class="{
51
+ :is="is"
52
+ v-bind="$attrs"
53
+ class="flex"
54
+ :class="{
48
55
  'join-item': props.join,
49
56
 
50
57
  'flex-1': props.flex1,
@@ -1,33 +1,36 @@
1
1
  <script setup lang="ts">
2
2
  import { computed } from 'vue'
3
3
 
4
- const props = withDefaults(defineProps<{
5
- is?: any
6
- join?: boolean
7
-
8
- // https://tailwindcss.com/docs/flex
9
- flex?: boolean
10
- flex1?: boolean
11
- flexAuto?: boolean
12
- flexInitial?: boolean
13
- none?: boolean
14
-
15
- grow?: boolean
16
-
17
- // https://tailwindcss.com/docs/flex-direction
18
- direction?: 'row' | 'col' | 'row-reverse' | 'col-reverse'
19
- row?: boolean
20
- col?: boolean
21
- reverse?: boolean
22
-
23
- // https://tailwindcss.com/docs/flex-wrap
24
- wrap?: boolean
25
- nowrap?: boolean
26
- wrapReverse?: boolean
27
- }>(), {
28
- is: 'div',
29
- flex: false,
30
- })
4
+ const props = withDefaults(
5
+ defineProps<{
6
+ is?: any
7
+ join?: boolean
8
+
9
+ // https://tailwindcss.com/docs/flex
10
+ flex?: boolean
11
+ flex1?: boolean
12
+ flexAuto?: boolean
13
+ flexInitial?: boolean
14
+ none?: boolean
15
+
16
+ grow?: boolean
17
+
18
+ // https://tailwindcss.com/docs/flex-direction
19
+ direction?: 'row' | 'col' | 'row-reverse' | 'col-reverse'
20
+ row?: boolean
21
+ col?: boolean
22
+ reverse?: boolean
23
+
24
+ // https://tailwindcss.com/docs/flex-wrap
25
+ wrap?: boolean
26
+ nowrap?: boolean
27
+ wrapReverse?: boolean
28
+ }>(),
29
+ {
30
+ is: 'div',
31
+ flex: false,
32
+ },
33
+ )
31
34
 
32
35
  const classes = computed(() => {
33
36
  return {
@@ -1,21 +1,25 @@
1
1
  <script setup lang="ts">
2
- import Text from './Text.vue';
2
+ import Text from './Text.vue'
3
3
 
4
- const props = withDefaults(defineProps<{
5
- center?: boolean
6
- is?: string
7
- orientation?: 'horizontal' | 'vertical'
8
- horizontal?: boolean
9
- vertical?: boolean
10
- }>(), {
11
- center: false,
12
- is: 'footer',
13
- })
4
+ const props = withDefaults(
5
+ defineProps<{
6
+ center?: boolean
7
+ is?: string
8
+ orientation?: 'horizontal' | 'vertical'
9
+ horizontal?: boolean
10
+ vertical?: boolean
11
+ }>(),
12
+ {
13
+ center: false,
14
+ is: 'footer',
15
+ },
16
+ )
14
17
  </script>
15
18
 
16
19
  <template>
17
20
  <Text
18
- :is="is" class="footer"
21
+ :is="is"
22
+ class="footer"
19
23
  :class="{
20
24
  'divider-center': props.center,
21
25
  'divider-horizontal': props.horizontal || props.orientation === 'horizontal',
@@ -1,11 +1,14 @@
1
1
  <script setup lang="ts">
2
2
  import Text from './Text.vue'
3
3
 
4
- withDefaults(defineProps<{
5
- is?: string
6
- }>(), {
7
- is: 'span',
8
- })
4
+ withDefaults(
5
+ defineProps<{
6
+ is?: string
7
+ }>(),
8
+ {
9
+ is: 'span',
10
+ },
11
+ )
9
12
  </script>
10
13
 
11
14
  <template>
@@ -1,11 +1,14 @@
1
1
  <script setup lang="ts">
2
- import Text from './Text.vue';
2
+ import Text from './Text.vue'
3
3
 
4
- withDefaults(defineProps<{
5
- is?: string
6
- }>(), {
7
- is: 'div',
8
- })
4
+ withDefaults(
5
+ defineProps<{
6
+ is?: string
7
+ }>(),
8
+ {
9
+ is: 'div',
10
+ },
11
+ )
9
12
  </script>
10
13
 
11
14
  <template>
@@ -1,11 +1,14 @@
1
1
  <script setup lang="ts">
2
- import Text from './Text.vue';
2
+ import Text from './Text.vue'
3
3
 
4
- withDefaults(defineProps<{
5
- is?: string
6
- }>(), {
7
- is: 'div',
8
- })
4
+ withDefaults(
5
+ defineProps<{
6
+ is?: string
7
+ }>(),
8
+ {
9
+ is: 'div',
10
+ },
11
+ )
9
12
  </script>
10
13
 
11
14
  <template>
@@ -0,0 +1,22 @@
1
+ <script setup lang="ts">
2
+ const props = defineProps<{
3
+ is?: any
4
+ disabled?: boolean
5
+ }>()
6
+ </script>
7
+
8
+ <template>
9
+ <component :is="props.is || 'div'" :class="{ 'hover-3d': !props.disabled }">
10
+ <slot />
11
+ <template v-if="!props.disabled">
12
+ <div></div>
13
+ <div></div>
14
+ <div></div>
15
+ <div></div>
16
+ <div></div>
17
+ <div></div>
18
+ <div></div>
19
+ <div></div>
20
+ </template>
21
+ </component>
22
+ </template>
@@ -0,0 +1,11 @@
1
+ <script setup lang="ts">
2
+ const props = defineProps<{
3
+ is?: any
4
+ }>()
5
+ </script>
6
+
7
+ <template>
8
+ <component :is="props.is || 'figure'" class="hover-gallery">
9
+ <slot />
10
+ </component>
11
+ </template>
@@ -1,13 +1,20 @@
1
1
  <script setup lang="ts">
2
- withDefaults(defineProps<{
3
- is?: string
4
- }>(), {
5
- is: 'div',
2
+ defineOptions({
3
+ inheritAttrs: false,
6
4
  })
5
+
6
+ withDefaults(
7
+ defineProps<{
8
+ is?: string
9
+ }>(),
10
+ {
11
+ is: 'div',
12
+ },
13
+ )
7
14
  </script>
8
15
 
9
16
  <template>
10
- <component :is="is" class="indicator">
17
+ <component :is="is" v-bind="$attrs" class="indicator">
11
18
  <slot />
12
19
  </component>
13
20
  </template>
@@ -1,21 +1,28 @@
1
1
  <script setup lang="ts">
2
2
  import { computed } from 'vue'
3
3
 
4
- const props = withDefaults(defineProps<{
5
- is?: string
4
+ defineOptions({
5
+ inheritAttrs: false,
6
+ })
6
7
 
7
- align?: 'start' | 'center' | 'end'
8
- start?: boolean
9
- center?: boolean
10
- end?: boolean
8
+ const props = withDefaults(
9
+ defineProps<{
10
+ is?: string
11
11
 
12
- vAlign?: 'top' | 'middle' | 'bottom'
13
- top?: boolean
14
- middle?: boolean
15
- bottom?: boolean
16
- }>(), {
17
- is: 'div',
18
- })
12
+ align?: 'start' | 'center' | 'end'
13
+ start?: boolean
14
+ center?: boolean
15
+ end?: boolean
16
+
17
+ vAlign?: 'top' | 'middle' | 'bottom'
18
+ top?: boolean
19
+ middle?: boolean
20
+ bottom?: boolean
21
+ }>(),
22
+ {
23
+ is: 'div',
24
+ },
25
+ )
19
26
  const classes = computed(() => {
20
27
  return {
21
28
  'indicator-start': props.start || props.align === 'start',
@@ -30,7 +37,7 @@ const classes = computed(() => {
30
37
  </script>
31
38
 
32
39
  <template>
33
- <component :is="is" class="indicator-item" :class="classes">
40
+ <component :is="is" v-bind="$attrs" class="indicator-item" :class="classes">
34
41
  <slot />
35
42
  </component>
36
43
  </template>