daisy-ui-kit 5.0.0-pre.9 → 5.0.1

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 (94) hide show
  1. package/README.md +277 -48
  2. package/app/components/Accordion.vue +8 -5
  3. package/app/components/Alert.vue +2 -1
  4. package/app/components/Avatar.vue +10 -7
  5. package/app/components/AvatarGroup.vue +6 -2
  6. package/app/components/Badge.vue +19 -1
  7. package/app/components/Button.vue +66 -46
  8. package/app/components/Calendar.vue +151 -42
  9. package/app/components/CalendarInput.vue +229 -130
  10. package/app/components/CalendarSkeleton.vue +51 -10
  11. package/app/components/Card.vue +20 -2
  12. package/app/components/CardActions.vue +1 -1
  13. package/app/components/CardBody.vue +1 -1
  14. package/app/components/CardTitle.vue +1 -1
  15. package/app/components/Carousel.vue +2 -1
  16. package/app/components/Chat.vue +6 -1
  17. package/app/components/Checkbox.vue +1 -1
  18. package/app/components/Collapse.vue +38 -5
  19. package/app/components/CollapseTitle.vue +11 -1
  20. package/app/components/Countdown.vue +3 -3
  21. package/app/components/CountdownTimers.vue +4 -7
  22. package/app/components/Counter.vue +14 -3
  23. package/app/components/DaisyLink.vue +33 -15
  24. package/app/components/Dock.vue +5 -6
  25. package/app/components/DockItem.vue +5 -3
  26. package/app/components/Drawer.vue +15 -12
  27. package/app/components/DrawerContent.vue +9 -6
  28. package/app/components/DrawerSide.vue +9 -6
  29. package/app/components/Dropdown.vue +61 -50
  30. package/app/components/DropdownButton.vue +11 -4
  31. package/app/components/DropdownContent.vue +90 -20
  32. package/app/components/DropdownTarget.vue +10 -3
  33. package/app/components/Fab.vue +16 -0
  34. package/app/components/FabClose.vue +18 -0
  35. package/app/components/FabMainAction.vue +5 -0
  36. package/app/components/FabTrigger.vue +117 -0
  37. package/app/components/Fieldset.vue +5 -4
  38. package/app/components/FileInput.vue +1 -1
  39. package/app/components/Filter.vue +45 -38
  40. package/app/components/Flex.vue +8 -1
  41. package/app/components/FlexItem.vue +30 -27
  42. package/app/components/Footer.vue +16 -12
  43. package/app/components/FooterTitle.vue +8 -5
  44. package/app/components/Hero.vue +9 -6
  45. package/app/components/HeroContent.vue +9 -6
  46. package/app/components/Hover3D.vue +22 -0
  47. package/app/components/HoverGallery.vue +11 -0
  48. package/app/components/Indicator.vue +12 -5
  49. package/app/components/IndicatorItem.vue +21 -14
  50. package/app/components/Input.vue +44 -47
  51. package/app/components/Kbd.vue +2 -1
  52. package/app/components/Label.vue +32 -29
  53. package/app/components/MenuExpand.vue +5 -13
  54. package/app/components/MenuExpandToggle.vue +7 -1
  55. package/app/components/MenuItem.vue +6 -4
  56. package/app/components/Modal.vue +23 -17
  57. package/app/components/Progress.vue +13 -1
  58. package/app/components/Prose.vue +7 -2
  59. package/app/components/RadialProgress.vue +8 -8
  60. package/app/components/Radio.vue +1 -1
  61. package/app/components/RadioGroup.vue +2 -2
  62. package/app/components/Range.vue +186 -46
  63. package/app/components/RangeMeasure.vue +33 -30
  64. package/app/components/RangeMeasureTick.vue +4 -5
  65. package/app/components/Rating.vue +70 -53
  66. package/app/components/Select.vue +44 -47
  67. package/app/components/SkeletonText.vue +11 -0
  68. package/app/components/Stack.vue +5 -0
  69. package/app/components/Steps.vue +7 -2
  70. package/app/components/Swap.vue +4 -10
  71. package/app/components/Tab.vue +23 -5
  72. package/app/components/Text.vue +47 -23
  73. package/app/components/TextArea.vue +75 -30
  74. package/app/components/TextRotate.vue +24 -0
  75. package/app/components/ThemeController.vue +3 -4
  76. package/app/components/ThemeProvider.vue +47 -32
  77. package/app/components/TimelineLine.vue +1 -1
  78. package/app/components/TimelineStart.vue +2 -1
  79. package/app/components/Toast.vue +3 -8
  80. package/app/components/Toggle.vue +2 -2
  81. package/app/components/Tooltip.vue +111 -21
  82. package/app/components/TooltipContent.vue +279 -1
  83. package/app/components/TooltipTarget.vue +20 -0
  84. package/app/composables/__tests__/use-calendar.test.ts +239 -0
  85. package/app/composables/use-calendar.ts +288 -0
  86. package/app/composables/use-daisy-theme.ts +140 -0
  87. package/app/composables/use-toast.ts +345 -0
  88. package/app/composables/useSearch.ts +22 -0
  89. package/app/utils/drawer-utils.ts +15 -13
  90. package/app/utils/position-area.ts +40 -0
  91. package/nuxt.d.ts +13 -0
  92. package/nuxt.js +12 -9
  93. package/package.json +34 -17
  94. package/app/utils/random-string.ts +0 -19
@@ -25,8 +25,13 @@
25
25
  @apply text-accent;
26
26
  }
27
27
 
28
- .prose h1 a, .prose h2 a, .prose h3 a, .prose h4 a, .prose h5 a, .prose h6 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': (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'),
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
  >
@@ -65,5 +65,5 @@ const currentValue = computed({
65
65
  }"
66
66
  :disabled="props.disabled"
67
67
  :value="props.value"
68
- >
68
+ />
69
69
  </template>
@@ -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: (val) => {
31
+ set: val => {
32
32
  emit('update:modelValue', val)
33
33
  },
34
34
  })
@@ -1,61 +1,201 @@
1
1
  <script setup lang="ts">
2
- import { computed } from 'vue';
3
-
4
- const props = defineProps<{
5
- modelValue?: number | string
6
- min?: number | string
7
- max?: number | string
8
- step?: number | string
9
- disabled?: boolean
10
-
11
- color?: string
12
- neutral?: boolean
13
- primary?: boolean
14
- secondary?: boolean
15
- accent?: boolean
16
- success?: boolean
17
- warning?: boolean
18
- info?: boolean
19
- error?: boolean
20
-
21
- size?: 'xl' | 'lg' | 'md' | 'sm' | 'xs'
22
- xl?: boolean
23
- lg?: boolean
24
- md?: boolean
25
- sm?: boolean
26
- xs?: boolean
27
- }>()
2
+ import { computed } from 'vue'
3
+
4
+ const props = withDefaults(
5
+ defineProps<{
6
+ modelValue?: number | [number, number]
7
+ min?: number
8
+ max?: number
9
+ step?: number
10
+ disabled?: boolean
11
+
12
+ color?: string
13
+ neutral?: boolean
14
+ primary?: boolean
15
+ secondary?: boolean
16
+ accent?: boolean
17
+ success?: boolean
18
+ warning?: boolean
19
+ info?: boolean
20
+ error?: boolean
21
+
22
+ size?: 'xl' | 'lg' | 'md' | 'sm' | 'xs'
23
+ xl?: boolean
24
+ lg?: boolean
25
+ md?: boolean
26
+ sm?: boolean
27
+ xs?: boolean
28
+ }>(),
29
+ {
30
+ min: 0,
31
+ max: 100,
32
+ step: 1,
33
+ },
34
+ )
28
35
  const emit = defineEmits(['update:modelValue'])
29
36
 
30
- const currentValue = computed({
31
- get: () => props.modelValue,
32
- set: val => emit('update:modelValue', val),
37
+ const isRange = computed(() => {
38
+ return Array.isArray(props.modelValue)
39
+ })
40
+
41
+ const singleValue = computed({
42
+ get: () => (isRange.value ? 0 : (props.modelValue as number)),
43
+ set: val => emit('update:modelValue', Number(val)),
44
+ })
45
+
46
+ const lowValue = computed({
47
+ get: () => (isRange.value ? (props.modelValue as [number, number])[0] : 0),
48
+ set: val => {
49
+ const v = Number(val)
50
+ const high = (props.modelValue as [number, number])[1]
51
+ emit('update:modelValue', [Math.min(v, high), high])
52
+ },
53
+ })
54
+
55
+ const highValue = computed({
56
+ get: () => (isRange.value ? (props.modelValue as [number, number])[1] : 100),
57
+ set: val => {
58
+ const v = Number(val)
59
+ const low = (props.modelValue as [number, number])[0]
60
+ emit('update:modelValue', [low, Math.max(v, low)])
61
+ },
62
+ })
63
+
64
+ const rangeClasses = computed(() => ({
65
+ 'range-neutral': props.neutral || props.color === 'neutral',
66
+ 'range-primary': props.primary || props.color === 'primary',
67
+ 'range-secondary': props.secondary || props.color === 'secondary',
68
+ 'range-accent': props.accent || props.color === 'accent',
69
+ 'range-success': props.success || props.color === 'success',
70
+ 'range-info': props.info || props.color === 'info',
71
+ 'range-warning': props.warning || props.color === 'warning',
72
+ 'range-error': props.error || props.color === 'error',
73
+ 'range-xl': props.xl || props.size === 'xl',
74
+ 'range-lg': props.lg || props.size === 'lg',
75
+ 'range-md': props.md || props.size === 'md',
76
+ 'range-sm': props.sm || props.size === 'sm',
77
+ 'range-xs': props.xs || props.size === 'xs',
78
+ }))
79
+
80
+ // Calculate percentage positions for the filled track
81
+ const lowPercent = computed(() => {
82
+ const range = props.max - props.min
83
+ return ((lowValue.value - props.min) / range) * 100
84
+ })
85
+
86
+ const highPercent = computed(() => {
87
+ const range = props.max - props.min
88
+ return ((highValue.value - props.min) / range) * 100
33
89
  })
34
90
  </script>
35
91
 
36
92
  <template>
93
+ <!-- Single value mode -->
37
94
  <input
38
- v-model="currentValue"
95
+ v-if="!isRange"
96
+ v-model="singleValue"
39
97
  type="range"
40
98
  class="range"
41
- :class="{
42
- 'range-neutral': neutral || color === 'neutral',
43
- 'range-primary': primary || color === 'primary',
44
- 'range-secondary': secondary || color === 'secondary',
45
- 'range-accent': accent || color === 'accent',
46
- 'range-success': success || color === 'success',
47
- 'range-info': info || color === 'info',
48
- 'range-warning': warning || color === 'warning',
49
- 'range-error': error || color === 'error',
50
- 'range-xl': xl || size === 'xl',
51
- 'range-lg': lg || size === 'lg',
52
- 'range-md': md || size === 'md',
53
- 'range-sm': sm || size === 'sm',
54
- 'range-xs': xs || size === 'xs',
55
- }"
99
+ :class="rangeClasses"
56
100
  :min="min"
57
101
  :max="max"
58
102
  :step="step"
59
103
  :disabled="disabled"
60
- >
104
+ />
105
+
106
+ <!-- Dual handle range mode -->
107
+ <div v-else class="range range-slider-wrapper" :class="rangeClasses">
108
+ <div class="range-slider-track" />
109
+ <div
110
+ class="range-slider-fill"
111
+ :style="{
112
+ left: `calc(${lowPercent}% + (var(--range-thumb-size, 1.5rem) / 2) - (${lowPercent} * var(--range-thumb-size, 1.5rem) / 100))`,
113
+ width: `calc(${highPercent - lowPercent}% - (${highPercent - lowPercent} * var(--range-thumb-size, 1.5rem) / 100))`,
114
+ }"
115
+ />
116
+ <input
117
+ v-model="lowValue"
118
+ type="range"
119
+ class="range range-slider-input"
120
+ :class="rangeClasses"
121
+ :min="min"
122
+ :max="max"
123
+ :step="step"
124
+ :disabled="disabled"
125
+ />
126
+ <input
127
+ v-model="highValue"
128
+ type="range"
129
+ class="range range-slider-input"
130
+ :class="rangeClasses"
131
+ :min="min"
132
+ :max="max"
133
+ :step="step"
134
+ :disabled="disabled"
135
+ />
136
+ </div>
61
137
  </template>
138
+
139
+ <style>
140
+ .range-slider-wrapper {
141
+ position: relative;
142
+ width: 100%;
143
+ height: var(--range-thumb-size, 1.5rem);
144
+ }
145
+
146
+ .range-slider-track {
147
+ position: absolute;
148
+ top: 50%;
149
+ left: 0;
150
+ right: 0;
151
+ height: calc(var(--range-thumb-size, 1.5rem) / 3);
152
+ transform: translateY(-50%);
153
+ background: color-mix(in oklab, currentColor 10%, transparent);
154
+ border-radius: var(--radius-selector, 1rem);
155
+ }
156
+
157
+ .range-slider-fill {
158
+ position: absolute;
159
+ top: 50%;
160
+ height: var(--range-thumb-size, 1.5rem);
161
+ transform: translateY(-50%);
162
+ background: currentColor;
163
+ border-radius: 0;
164
+ z-index: 1;
165
+ }
166
+
167
+ .range-slider-input {
168
+ position: absolute;
169
+ top: 0;
170
+ left: 0;
171
+ width: 100%;
172
+ height: 100%;
173
+ pointer-events: none;
174
+ background: transparent;
175
+ --range-fill: 0 !important;
176
+ }
177
+
178
+ /* Hide both tracks - we draw our own */
179
+ .range-slider-input::-webkit-slider-runnable-track {
180
+ background: transparent !important;
181
+ box-shadow: none !important;
182
+ }
183
+
184
+ .range-slider-input::-moz-range-track {
185
+ background: transparent !important;
186
+ box-shadow: none !important;
187
+ }
188
+
189
+ /* Enable pointer events only on thumbs */
190
+ .range-slider-input::-webkit-slider-thumb {
191
+ pointer-events: auto;
192
+ position: relative;
193
+ z-index: 3;
194
+ }
195
+
196
+ .range-slider-input::-moz-range-thumb {
197
+ pointer-events: auto;
198
+ position: relative;
199
+ z-index: 3;
200
+ }
201
+ </style>
@@ -1,37 +1,40 @@
1
1
  <script setup lang="ts">
2
- import { computed } from 'vue';
2
+ import { computed } from 'vue'
3
3
 
4
- const props = withDefaults(defineProps<{
5
- modelValue?: number | string
6
- min?: number | string
7
- max?: number | string
8
- step?: number | string
4
+ const props = withDefaults(
5
+ defineProps<{
6
+ modelValue?: number | string
7
+ min?: number | string
8
+ max?: number | string
9
+ step?: number | string
9
10
 
10
- numbered?: boolean
11
- asButtons?: boolean
12
- disabled?: boolean
11
+ numbered?: boolean
12
+ asButtons?: boolean
13
+ disabled?: boolean
13
14
 
14
- color?: string
15
- neutral?: boolean
16
- primary?: boolean
17
- secondary?: boolean
18
- accent?: boolean
19
- success?: boolean
20
- warning?: boolean
21
- info?: boolean
22
- error?: boolean
15
+ color?: string
16
+ neutral?: boolean
17
+ primary?: boolean
18
+ secondary?: boolean
19
+ accent?: boolean
20
+ success?: boolean
21
+ warning?: boolean
22
+ info?: boolean
23
+ error?: boolean
23
24
 
24
- size?: 'xl' | 'lg' | 'md' | 'sm' | 'xs'
25
- xl?: boolean
26
- lg?: boolean
27
- md?: boolean
28
- sm?: boolean
29
- xs?: boolean
30
- }>(), {
31
- min: 0,
32
- max: 100,
33
- step: 1,
34
- })
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
+ min: 0,
34
+ max: 100,
35
+ step: 1,
36
+ },
37
+ )
35
38
  defineEmits(['update:modelValue'])
36
39
 
37
40
  const values = computed(() => {
@@ -76,7 +79,7 @@ const values = computed(() => {
76
79
  :as-button="asButtons"
77
80
  :is-hidden="!tick.isVisible"
78
81
  :disabled="disabled"
79
- @update:model-value="(val) => !disabled && $emit('update:modelValue', val)"
82
+ @update:model-value="val => !disabled && $emit('update:modelValue', val)"
80
83
  >
81
84
  {{ numbered ? tick : '|' }}
82
85
  </RangeMeasureTick>
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
- import { useTimeoutFn } from '@vueuse/core';
3
- import { computed, watch } from 'vue';
2
+ import { useTimeoutFn } from '@vueuse/core'
3
+ import { computed, ref, watch } from 'vue'
4
4
 
5
5
  const props = defineProps<{
6
6
  tick: number
@@ -18,12 +18,11 @@ const { isPending, start, stop } = useTimeoutFn(() => {
18
18
  }, 1000)
19
19
  watch(
20
20
  () => props.modelValue,
21
- (val) => {
21
+ val => {
22
22
  if (val) {
23
23
  start()
24
24
  hasChanged.value = true
25
- }
26
- else if (!isPending.value) {
25
+ } else if (!isPending.value) {
27
26
  stop()
28
27
  }
29
28
  },
@@ -1,52 +1,55 @@
1
1
  <script setup lang="ts">
2
2
  import { computed } from 'vue'
3
3
 
4
- const props = withDefaults(defineProps<{
5
- modelValue?: number | string
6
- count?: number | string
7
- half?: boolean
8
-
9
- disabled?: boolean
10
-
11
- color?: string
12
- neutral?: boolean
13
- primary?: boolean
14
- secondary?: boolean
15
- accent?: boolean
16
- info?: boolean
17
- success?: boolean
18
- warning?: boolean
19
- error?: boolean
20
-
21
- bg?: string
22
-
23
- shape?: string
24
- squircle?: boolean
25
- heart?: boolean
26
- hexagon?: boolean
27
- hexagon2?: boolean
28
- decagon?: boolean
29
- pentagon?: boolean
30
- diamond?: boolean
31
- square?: boolean
32
- circle?: boolean
33
-
34
- star?: boolean
35
- star2?: boolean
36
- triangle?: boolean
37
- triangle2?: boolean
38
- triangle3?: boolean
39
- triangle4?: boolean
40
-
41
- size?: 'lg' | 'md' | 'sm' | 'xs' | 'xl'
42
- xl?: boolean
43
- lg?: boolean
44
- md?: boolean
45
- sm?: boolean
46
- xs?: boolean
47
- }>(), {
48
- count: 5,
49
- })
4
+ const props = withDefaults(
5
+ defineProps<{
6
+ modelValue?: number | string
7
+ count?: number | string
8
+ half?: boolean
9
+
10
+ disabled?: 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
+ bg?: string
23
+
24
+ shape?: string
25
+ squircle?: boolean
26
+ heart?: boolean
27
+ hexagon?: boolean
28
+ hexagon2?: boolean
29
+ decagon?: boolean
30
+ pentagon?: boolean
31
+ diamond?: boolean
32
+ square?: boolean
33
+ circle?: boolean
34
+
35
+ star?: boolean
36
+ star2?: boolean
37
+ triangle?: boolean
38
+ triangle2?: boolean
39
+ triangle3?: boolean
40
+ triangle4?: boolean
41
+
42
+ size?: 'lg' | 'md' | 'sm' | 'xs' | 'xl'
43
+ xl?: boolean
44
+ lg?: boolean
45
+ md?: boolean
46
+ sm?: boolean
47
+ xs?: boolean
48
+ }>(),
49
+ {
50
+ count: 5,
51
+ },
52
+ )
50
53
  const emit = defineEmits(['update:modelValue'])
51
54
 
52
55
  const max = computed(() => Number.parseInt(props.count as string))
@@ -66,10 +69,24 @@ function handleValue(digit: number, half = false) {
66
69
 
67
70
  // Check if any shape prop is set
68
71
  const hasShape = computed(() => {
69
- return props.shape || props.squircle || props.heart || props.hexagon
70
- || props.hexagon2 || props.decagon || props.pentagon || props.diamond
71
- || props.square || props.circle || props.star || props.star2
72
- || props.triangle || props.triangle2 || props.triangle3 || props.triangle4
72
+ return (
73
+ props.shape ||
74
+ props.squircle ||
75
+ props.heart ||
76
+ props.hexagon ||
77
+ props.hexagon2 ||
78
+ props.decagon ||
79
+ props.pentagon ||
80
+ props.diamond ||
81
+ props.square ||
82
+ props.circle ||
83
+ props.star ||
84
+ props.star2 ||
85
+ props.triangle ||
86
+ props.triangle2 ||
87
+ props.triangle3 ||
88
+ props.triangle4
89
+ )
73
90
  })
74
91
  </script>
75
92
 
@@ -93,7 +110,7 @@ const hasShape = computed(() => {
93
110
  class="rating-hidden"
94
111
  :checked="modelValue === 0"
95
112
  @change="$emit('update:modelValue', 0)"
96
- >
113
+ />
97
114
  <template v-for="digit in max" :key="digit">
98
115
  <input
99
116
  type="radio"
@@ -134,7 +151,7 @@ const hasShape = computed(() => {
134
151
  ]"
135
152
  :checked="half ? modelValue === digit - 0.5 : modelValue === digit"
136
153
  @change="() => handleValue(digit, true)"
137
- >
154
+ />
138
155
  <input
139
156
  v-if="half"
140
157
  type="radio"
@@ -174,7 +191,7 @@ const hasShape = computed(() => {
174
191
  ]"
175
192
  :checked="modelValue === digit"
176
193
  @change="() => handleValue(digit)"
177
- >
194
+ />
178
195
  </template>
179
196
  </div>
180
197
  </template>