daisy-ui-kit 5.0.0-pre.10 → 5.0.0-pre.11

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 (81) 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 +14 -1
  6. package/app/components/Button.vue +60 -45
  7. package/app/components/Calendar.vue +24 -1
  8. package/app/components/CalendarInput.vue +2 -2
  9. package/app/components/CalendarSkeleton.vue +51 -10
  10. package/app/components/Card.vue +15 -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 +37 -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 +13 -2
  22. package/app/components/DaisyLink.vue +29 -15
  23. package/app/components/Dock.vue +1 -1
  24. package/app/components/DockItem.vue +1 -1
  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 -19
  31. package/app/components/DropdownTarget.vue +9 -2
  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 +1 -4
  37. package/app/components/FileInput.vue +1 -1
  38. package/app/components/Filter.vue +35 -32
  39. package/app/components/Flex.vue +3 -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 +8 -5
  48. package/app/components/IndicatorItem.vue +16 -13
  49. package/app/components/Input.vue +47 -40
  50. package/app/components/Kbd.vue +2 -1
  51. package/app/components/Label.vue +32 -29
  52. package/app/components/MenuExpand.vue +1 -7
  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 +2 -2
  62. package/app/components/RangeMeasure.vue +33 -30
  63. package/app/components/Rating.vue +70 -53
  64. package/app/components/Select.vue +44 -47
  65. package/app/components/SkeletonText.vue +11 -0
  66. package/app/components/Steps.vue +7 -2
  67. package/app/components/Swap.vue +4 -10
  68. package/app/components/Tab.vue +18 -5
  69. package/app/components/Text.vue +42 -22
  70. package/app/components/TextArea.vue +30 -27
  71. package/app/components/TextRotate.vue +24 -0
  72. package/app/components/ThemeController.vue +3 -4
  73. package/app/components/ThemeProvider.vue +47 -32
  74. package/app/components/TimelineLine.vue +1 -1
  75. package/app/components/TimelineStart.vue +2 -1
  76. package/app/components/Toast.vue +1 -6
  77. package/app/components/Toggle.vue +2 -2
  78. package/app/components/Tooltip.vue +2 -1
  79. package/app/utils/drawer-utils.ts +15 -13
  80. package/app/utils/position-area.ts +41 -0
  81. package/package.json +9 -7
@@ -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>
@@ -8,36 +8,39 @@ interface FilterItem {
8
8
 
9
9
  type FilterItemInput = string | FilterItem
10
10
 
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
11
+ const props = withDefaults(
12
+ defineProps<{
13
+ is?: string
14
+ name: string
15
+ items: FilterItemInput[]
16
+ modelValue?: any
17
+ resetLabel?: string
18
+ position?: 'start' | 'end'
19
+ start?: boolean
20
+ end?: boolean
20
21
 
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
22
+ color?: string
23
+ neutral?: boolean
24
+ primary?: boolean
25
+ secondary?: boolean
26
+ accent?: boolean
27
+ info?: boolean
28
+ success?: boolean
29
+ warning?: boolean
30
+ error?: boolean
30
31
 
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
- })
32
+ size?: 'xl' | 'lg' | 'md' | 'sm' | 'xs'
33
+ xl?: boolean
34
+ lg?: boolean
35
+ md?: boolean
36
+ sm?: boolean
37
+ xs?: boolean
38
+ }>(),
39
+ {
40
+ resetLabel: 'All',
41
+ is: 'div',
42
+ },
43
+ )
41
44
 
42
45
  const emit = defineEmits(['update:modelValue'])
43
46
 
@@ -49,7 +52,7 @@ const currentValue = computed({
49
52
  })
50
53
 
51
54
  const normalizedItems = computed(() => {
52
- return props.items.map((item) => {
55
+ return props.items.map(item => {
53
56
  if (typeof item === 'string') {
54
57
  return { label: item, value: item }
55
58
  }
@@ -76,7 +79,7 @@ const normalizedItems = computed(() => {
76
79
  :name="name"
77
80
  :aria-label="resetLabel"
78
81
  :value="null"
79
- >
82
+ />
80
83
 
81
84
  <!-- Filter items -->
82
85
  <template v-for="(item, index) in normalizedItems" :key="index">
@@ -102,7 +105,7 @@ const normalizedItems = computed(() => {
102
105
  :name="name"
103
106
  :aria-label="item.label"
104
107
  :value="item.value"
105
- >
108
+ />
106
109
  </template>
107
110
 
108
111
  <!-- Reset button at end -->
@@ -114,7 +117,7 @@ const normalizedItems = computed(() => {
114
117
  :name="name"
115
118
  :aria-label="resetLabel"
116
119
  :value="null"
117
- >
120
+ />
118
121
 
119
122
  <!-- Optional slot for custom items -->
120
123
  <slot />
@@ -44,7 +44,9 @@ const { is = 'div', ...props } = defineProps<{
44
44
 
45
45
  <template>
46
46
  <component
47
- :is="is" class="flex" :class="{
47
+ :is="is"
48
+ class="flex"
49
+ :class="{
48
50
  'join-item': props.join,
49
51
 
50
52
  '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,9 +1,12 @@
1
1
  <script setup lang="ts">
2
- withDefaults(defineProps<{
3
- is?: string
4
- }>(), {
5
- is: 'div',
6
- })
2
+ withDefaults(
3
+ defineProps<{
4
+ is?: string
5
+ }>(),
6
+ {
7
+ is: 'div',
8
+ },
9
+ )
7
10
  </script>
8
11
 
9
12
  <template>
@@ -1,21 +1,24 @@
1
1
  <script setup lang="ts">
2
2
  import { computed } from 'vue'
3
3
 
4
- const props = withDefaults(defineProps<{
5
- is?: string
4
+ const props = withDefaults(
5
+ defineProps<{
6
+ is?: string
6
7
 
7
- align?: 'start' | 'center' | 'end'
8
- start?: boolean
9
- center?: boolean
10
- end?: boolean
8
+ align?: 'start' | 'center' | 'end'
9
+ start?: boolean
10
+ center?: boolean
11
+ end?: boolean
11
12
 
12
- vAlign?: 'top' | 'middle' | 'bottom'
13
- top?: boolean
14
- middle?: boolean
15
- bottom?: boolean
16
- }>(), {
17
- is: 'div',
18
- })
13
+ vAlign?: 'top' | 'middle' | 'bottom'
14
+ top?: boolean
15
+ middle?: boolean
16
+ bottom?: boolean
17
+ }>(),
18
+ {
19
+ is: 'div',
20
+ },
21
+ )
19
22
  const classes = computed(() => {
20
23
  return {
21
24
  'indicator-start': props.start || props.align === 'start',
@@ -1,36 +1,49 @@
1
1
  <script setup lang="ts">
2
- import { syncRef } from '@vueuse/core'
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' | 'password' | 'email' | 'number' | 'date' | 'datetime-local' | 'week' | 'month' | 'tel' | 'url' | 'search' | 'time'
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(defineProps<{
10
- modelValue?: string | number | null
11
- type?: InputType
12
- placeholder?: string
13
- disabled?: boolean
14
- validator?: boolean
15
- join?: boolean
16
- color?: string
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
- type: 'text',
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
@@ -45,18 +58,17 @@ function handleInput(event: Event) {
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
65
 
54
66
  // Sync checked only on input if it's a checkbox
55
67
  if (
56
- props.type === 'checkbox'
57
- && labelCtx
58
- && Object.prototype.hasOwnProperty.call(labelCtx, 'checked')
59
- && typeof labelCtx.checked.value === 'boolean'
68
+ props.type === 'checkbox' &&
69
+ labelCtx &&
70
+ Object.prototype.hasOwnProperty.call(labelCtx, 'checked') &&
71
+ typeof labelCtx.checked.value === 'boolean'
60
72
  ) {
61
73
  labelCtx.checked.value = Boolean(event.target.checked)
62
74
  }
@@ -110,10 +122,5 @@ const inputModel = computed({
110
122
  :input-model="inputModel"
111
123
  />
112
124
  </div>
113
- <input
114
- v-else
115
- v-bind="inputAttrs"
116
- :value="inputModel"
117
- @input="handleInput"
118
- >
125
+ <input v-else v-bind="inputAttrs" :value="inputModel" @input="handleInput" />
119
126
  </template>
@@ -11,7 +11,8 @@ defineProps<{
11
11
 
12
12
  <template>
13
13
  <kbd
14
- class="kbd" :class="{
14
+ class="kbd"
15
+ :class="{
15
16
  'kbd-xl': xl || size === 'xl',
16
17
  'kbd-lg': lg || size === 'lg',
17
18
  'kbd-md': md || size === 'md',
@@ -2,34 +2,37 @@
2
2
  import { provide, ref } from 'vue'
3
3
  import Text from './Text.vue'
4
4
 
5
- withDefaults(defineProps<{
6
- is?: string
7
- floating?: boolean
5
+ withDefaults(
6
+ defineProps<{
7
+ is?: string
8
+ floating?: boolean
8
9
 
9
- input?: boolean
10
- select?: boolean
11
- toggle?: boolean
10
+ input?: boolean
11
+ select?: boolean
12
+ toggle?: boolean
12
13
 
13
- join?: boolean
14
- color?: string
15
- neutral?: boolean
16
- primary?: boolean
17
- secondary?: boolean
18
- accent?: boolean
19
- info?: boolean
20
- success?: boolean
21
- warning?: boolean
22
- error?: boolean
23
- ghost?: boolean
24
- size?: 'xl' | 'lg' | 'md' | 'sm' | 'xs'
25
- xl?: boolean
26
- lg?: boolean
27
- md?: boolean
28
- sm?: boolean
29
- xs?: boolean
30
- }>(), {
31
- is: 'label',
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
- 'input': input,
45
- 'select': select,
46
- 'toggle': toggle,
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'),
@@ -88,13 +88,7 @@ function handleClick(_ev: MouseEvent) {}
88
88
  </script>
89
89
 
90
90
  <template>
91
- <details
92
- :id="wrapperId"
93
- ref="expandEl"
94
- class="dropdown menu-expand"
95
- :open="isOpen"
96
- @click="handleClick"
97
- >
91
+ <details :id="wrapperId" ref="expandEl" class="dropdown menu-expand" :open="isOpen" @click="handleClick">
98
92
  <slot v-bind="{ toggle, open, close }" />
99
93
  </details>
100
94
  </template>
@@ -8,7 +8,13 @@ const { id, isOpen, toggle } = menuExpandState || {}
8
8
  </script>
9
9
 
10
10
  <template>
11
- <summary :id="id" :aria-expanded="isOpen" aria-haspopup="menu" class="menu-expand-toggle" @click.prevent.stop="toggle">
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, .menu-item.menu-active > span {
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, .menu-item.menu-disabled > span {
23
- background-color: var(--n)
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>