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

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 (198) hide show
  1. package/README.md +62 -14
  2. package/{components → app/components}/Accordion.vue +7 -10
  3. package/app/components/Alert.vue +35 -0
  4. package/app/components/Avatar.vue +128 -0
  5. package/app/components/AvatarGroup.vue +18 -0
  6. package/app/components/Badge.vue +54 -0
  7. package/app/components/Button.vue +120 -0
  8. package/app/components/Calendar.vue +66 -0
  9. package/app/components/CalendarInput.vue +174 -0
  10. package/app/components/CalendarSkeleton.vue +46 -0
  11. package/app/components/Card.vue +33 -0
  12. package/{components → app/components}/CardActions.vue +3 -6
  13. package/{components → app/components}/CardBody.vue +3 -6
  14. package/{components → app/components}/CardTitle.vue +2 -7
  15. package/app/components/Carousel.vue +23 -0
  16. package/app/components/Chat.vue +21 -0
  17. package/app/components/ChatBubble.vue +31 -0
  18. package/app/components/Checkbox.vue +51 -0
  19. package/app/components/Collapse.vue +43 -0
  20. package/app/components/Countdown.vue +15 -0
  21. package/app/components/CountdownTimers.vue +72 -0
  22. package/app/components/Counter.vue +10 -0
  23. package/app/components/DaisyLink.vue +38 -0
  24. package/app/components/Diff.vue +11 -0
  25. package/app/components/Divider.vue +43 -0
  26. package/app/components/Dock.vue +60 -0
  27. package/app/components/DockItem.vue +26 -0
  28. package/app/components/DockLabel.vue +5 -0
  29. package/{components → app/components}/Drawer.vue +6 -4
  30. package/{components → app/components}/DrawerContent.vue +1 -1
  31. package/{components → app/components}/DrawerSide.vue +1 -1
  32. package/{components → app/components}/Dropdown.vue +2 -2
  33. package/{components → app/components}/DropdownContent.vue +3 -3
  34. package/app/components/Fieldset.vue +19 -0
  35. package/app/components/FileInput.vue +53 -0
  36. package/app/components/Filter.vue +122 -0
  37. package/app/components/Flex.vue +82 -0
  38. package/{components → app/components}/FlexItem.vue +1 -1
  39. package/app/components/Footer.vue +27 -0
  40. package/app/components/FormControl.vue +5 -0
  41. package/{components → app/components}/Hero.vue +1 -1
  42. package/{components → app/components}/HeroContent.vue +1 -1
  43. package/app/components/Input.vue +119 -0
  44. package/app/components/Kbd.vue +24 -0
  45. package/app/components/Label.vue +97 -0
  46. package/app/components/List.vue +5 -0
  47. package/{components/FormControl.vue → app/components/ListColGrow.vue} +1 -1
  48. package/app/components/ListColWrap.vue +5 -0
  49. package/{components/Stat.vue → app/components/ListRow.vue} +1 -1
  50. package/app/components/LoadingBall.vue +42 -0
  51. package/app/components/LoadingBars.vue +42 -0
  52. package/app/components/LoadingDots.vue +42 -0
  53. package/app/components/LoadingInfinity.vue +42 -0
  54. package/app/components/LoadingRing.vue +42 -0
  55. package/app/components/LoadingSpinner.vue +42 -0
  56. package/app/components/Mask.vue +49 -0
  57. package/app/components/Menu.vue +30 -0
  58. package/app/components/MenuExpand.vue +100 -0
  59. package/{components → app/components}/MenuExpandToggle.vue +5 -4
  60. package/{components → app/components}/MenuItem.vue +3 -4
  61. package/app/components/MockupPhone.vue +14 -0
  62. package/{components → app/components}/Modal.vue +14 -5
  63. package/app/components/NavButton.vue +12 -0
  64. package/{components → app/components}/Navbar.vue +3 -5
  65. package/{components → app/components}/NavbarCenter.vue +3 -5
  66. package/{components → app/components}/NavbarEnd.vue +3 -5
  67. package/{components → app/components}/NavbarStart.vue +3 -5
  68. package/app/components/Progress.vue +34 -0
  69. package/{components → app/components}/Prose.vue +1 -1
  70. package/app/components/RadialProgress.vue +36 -0
  71. package/app/components/Radio.vue +69 -0
  72. package/{components → app/components}/RadioGroup.vue +2 -1
  73. package/app/components/Range.vue +61 -0
  74. package/{components → app/components}/RangeMeasure.vue +22 -21
  75. package/{components → app/components}/RangeMeasureTick.vue +9 -14
  76. package/app/components/Rating.vue +180 -0
  77. package/{components → app/components}/Select.vue +33 -29
  78. package/app/components/Skeleton.vue +5 -0
  79. package/app/components/Stack.vue +25 -0
  80. package/app/components/Stat.vue +19 -0
  81. package/app/components/Status.vue +43 -0
  82. package/app/components/Step.vue +34 -0
  83. package/app/components/StepIcon.vue +5 -0
  84. package/app/components/Steps.vue +18 -0
  85. package/app/components/Swap.vue +62 -0
  86. package/app/components/Tab.vue +38 -0
  87. package/{components → app/components}/TabContent.vue +10 -10
  88. package/app/components/Table.vue +32 -0
  89. package/app/components/Tabs.vue +53 -0
  90. package/app/components/Text.vue +142 -0
  91. package/app/components/TextArea.vue +61 -0
  92. package/app/components/ThemeController.vue +46 -0
  93. package/app/components/ThemeProvider.vue +287 -0
  94. package/app/components/ThemeTile.vue +50 -0
  95. package/app/components/Timeline.vue +22 -0
  96. package/app/components/TimelineEnd.vue +14 -0
  97. package/app/components/TimelineItem.vue +5 -0
  98. package/app/components/TimelineLine.vue +29 -0
  99. package/app/components/TimelineMiddle.vue +5 -0
  100. package/app/components/TimelineStart.vue +13 -0
  101. package/app/components/Toast.vue +72 -0
  102. package/app/components/Toggle.vue +60 -0
  103. package/app/components/Tooltip.vue +47 -0
  104. package/app/components/TooltipContent.vue +5 -0
  105. package/app/components/ValidatorHint.vue +5 -0
  106. package/nuxt.js +7 -1
  107. package/package.json +58 -61
  108. package/components/Alert.vue +0 -25
  109. package/components/Artboard.vue +0 -33
  110. package/components/Avatar.vue +0 -70
  111. package/components/AvatarGroup.vue +0 -19
  112. package/components/Badge.vue +0 -50
  113. package/components/BottomNav.vue +0 -25
  114. package/components/Button.vue +0 -111
  115. package/components/Card.vue +0 -30
  116. package/components/Carousel.vue +0 -25
  117. package/components/Chat.vue +0 -27
  118. package/components/ChatBubble.vue +0 -34
  119. package/components/Checkbox.vue +0 -55
  120. package/components/Code.vue +0 -92
  121. package/components/Collapse.vue +0 -54
  122. package/components/Countdown.vue +0 -15
  123. package/components/CountdownTimers.vue +0 -70
  124. package/components/Counter.vue +0 -14
  125. package/components/Divider.vue +0 -24
  126. package/components/FileInput.vue +0 -59
  127. package/components/Flex.vue +0 -59
  128. package/components/Footer.vue +0 -24
  129. package/components/Kbd.vue +0 -25
  130. package/components/Label.vue +0 -15
  131. package/components/LabelText.vue +0 -15
  132. package/components/LabelTextAlt.vue +0 -15
  133. package/components/Link.vue +0 -40
  134. package/components/LoadingBall.vue +0 -43
  135. package/components/LoadingBars.vue +0 -43
  136. package/components/LoadingDots.vue +0 -43
  137. package/components/LoadingInfinity.vue +0 -43
  138. package/components/LoadingRing.vue +0 -43
  139. package/components/LoadingSpinner.vue +0 -43
  140. package/components/Mask.config.ts +0 -77
  141. package/components/Mask.vue +0 -14
  142. package/components/Menu.vue +0 -35
  143. package/components/MenuExpand.vue +0 -79
  144. package/components/MockupPhone.vue +0 -8
  145. package/components/NavButton.vue +0 -20
  146. package/components/Progress.vue +0 -42
  147. package/components/RadialProgress.vue +0 -41
  148. package/components/Radio.vue +0 -76
  149. package/components/Range.vue +0 -60
  150. package/components/Rating.vue +0 -167
  151. package/components/Stack.vue +0 -13
  152. package/components/Step.vue +0 -36
  153. package/components/Steps.vue +0 -21
  154. package/components/Swap.vue +0 -58
  155. package/components/Tab.vue +0 -48
  156. package/components/Tabs.vue +0 -77
  157. package/components/TabsManager.vue +0 -38
  158. package/components/Text.vue +0 -142
  159. package/components/TextArea.vue +0 -64
  160. package/components/TextInput.vue +0 -66
  161. package/components/Toast.vue +0 -31
  162. package/components/Toggle.vue +0 -59
  163. package/components/Tooltip.vue +0 -47
  164. package/index.ts +0 -108
  165. package/utils/-utils.ts +0 -41
  166. package/utils/Button.config.ts +0 -26
  167. package/utils/fixtures.ts +0 -62
  168. package/utils/types.ts +0 -7
  169. /package/{components → app/components}/Breadcrumbs.vue +0 -0
  170. /package/{components → app/components}/CarouselItem.vue +0 -0
  171. /package/{components → app/components}/ChatFooter.vue +0 -0
  172. /package/{components → app/components}/ChatHeader.vue +0 -0
  173. /package/{components → app/components}/ChatImage.vue +0 -0
  174. /package/{components → app/components}/CollapseContent.vue +0 -0
  175. /package/{components → app/components}/CollapseTitle.vue +0 -0
  176. /package/{components → app/components}/Crumb.vue +0 -0
  177. /package/{components → app/components}/DropdownButton.vue +0 -0
  178. /package/{components → app/components}/DropdownTarget.vue +0 -0
  179. /package/{components → app/components}/FooterTitle.vue +0 -0
  180. /package/{components → app/components}/HeroOverlay.vue +0 -0
  181. /package/{components → app/components}/Indicator.vue +0 -0
  182. /package/{components → app/components}/IndicatorItem.vue +0 -0
  183. /package/{components → app/components}/Join.vue +0 -0
  184. /package/{components → app/components}/MenuTitle.vue +0 -0
  185. /package/{components → app/components}/MockupBrowser.vue +0 -0
  186. /package/{components → app/components}/MockupBrowserToolbar.vue +0 -0
  187. /package/{components → app/components}/MockupCode.vue +0 -0
  188. /package/{components → app/components}/MockupWindow.vue +0 -0
  189. /package/{components → app/components}/ModalAction.vue +0 -0
  190. /package/{components → app/components}/ModalBox.vue +0 -0
  191. /package/{components → app/components}/StatActions.vue +0 -0
  192. /package/{components → app/components}/StatDesc.vue +0 -0
  193. /package/{components → app/components}/StatFigure.vue +0 -0
  194. /package/{components → app/components}/StatTitle.vue +0 -0
  195. /package/{components → app/components}/StatValue.vue +0 -0
  196. /package/{components → app/components}/Stats.vue +0 -0
  197. /package/{utils → app/utils}/drawer-utils.ts +0 -0
  198. /package/{utils → app/utils}/random-string.ts +0 -0
@@ -0,0 +1,97 @@
1
+ <script setup lang="ts">
2
+ import { provide, ref } from 'vue'
3
+ import Text from './Text.vue'
4
+
5
+ withDefaults(defineProps<{
6
+ is?: string
7
+ floating?: boolean
8
+
9
+ input?: boolean
10
+ select?: boolean
11
+ toggle?: boolean
12
+
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
+ })
33
+
34
+ // Provide label context for child inputs
35
+ const checked = ref(false)
36
+ provide('labelCtx', { checked })
37
+ </script>
38
+
39
+ <template>
40
+ <Text
41
+ :is="is"
42
+ :class="[
43
+ {
44
+ 'input': input,
45
+ 'select': select,
46
+ 'toggle': toggle,
47
+ 'join-item': (input || select || toggle) && join,
48
+ 'input-neutral': input && (neutral || color === 'neutral'),
49
+ 'input-primary': input && (primary || color === 'primary'),
50
+ 'input-secondary': input && (secondary || color === 'secondary'),
51
+ 'input-accent': input && (accent || color === 'accent'),
52
+ 'input-info': input && (info || color === 'info'),
53
+ 'input-success': input && (success || color === 'success'),
54
+ 'input-warning': input && (warning || color === 'warning'),
55
+ 'input-error': input && (error || color === 'error'),
56
+ 'input-ghost': input && ghost,
57
+ 'input-xl': input && (size === 'xl' || xl),
58
+ 'input-lg': input && (size === 'lg' || lg),
59
+ 'input-md': input && (size === 'md' || md),
60
+ 'input-sm': input && (size === 'sm' || sm),
61
+ 'input-xs': input && (size === 'xs' || xs),
62
+ 'select-neutral': select && (neutral || color === 'neutral'),
63
+ 'select-primary': select && (primary || color === 'primary'),
64
+ 'select-secondary': select && (secondary || color === 'secondary'),
65
+ 'select-accent': select && (accent || color === 'accent'),
66
+ 'select-info': select && (info || color === 'info'),
67
+ 'select-success': select && (success || color === 'success'),
68
+ 'select-warning': select && (warning || color === 'warning'),
69
+ 'select-error': select && (error || color === 'error'),
70
+ 'select-ghost': select && ghost,
71
+ 'select-xl': select && (size === 'xl' || xl),
72
+ 'select-lg': select && (size === 'lg' || lg),
73
+ 'select-md': select && (size === 'md' || md),
74
+ 'select-sm': select && (size === 'sm' || sm),
75
+ 'select-xs': select && (size === 'xs' || xs),
76
+ 'text-neutral': toggle && checked && (neutral || color === 'neutral'),
77
+ 'text-primary': toggle && checked && (primary || color === 'primary'),
78
+ 'text-secondary': toggle && checked && (secondary || color === 'secondary'),
79
+ 'text-accent': toggle && checked && (accent || color === 'accent'),
80
+ 'text-info': toggle && checked && (info || color === 'info'),
81
+ 'text-success': toggle && checked && (success || color === 'success'),
82
+ 'text-warning': toggle && checked && (warning || color === 'warning'),
83
+ 'text-error': toggle && checked && (error || color === 'error'),
84
+ 'text-ghost': toggle && ghost,
85
+ 'toggle-xl': toggle && (size === 'xl' || xl),
86
+ 'toggle-lg': toggle && (size === 'lg' || lg),
87
+ 'toggle-md': toggle && (size === 'md' || md),
88
+ 'toggle-sm': toggle && (size === 'sm' || sm),
89
+ 'toggle-xs': toggle && (size === 'xs' || xs),
90
+ },
91
+ { label: !floating && !(input || toggle) },
92
+ { 'floating-label': floating },
93
+ ]"
94
+ >
95
+ <slot />
96
+ </Text>
97
+ </template>
@@ -0,0 +1,5 @@
1
+ <template>
2
+ <div class="list list-none">
3
+ <slot />
4
+ </div>
5
+ </template>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="form-control">
2
+ <div class="list-col-grow">
3
3
  <slot />
4
4
  </div>
5
5
  </template>
@@ -0,0 +1,5 @@
1
+ <template>
2
+ <div class="list-col-wrap">
3
+ <slot />
4
+ </div>
5
+ </template>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="stat">
2
+ <div class="list-row">
3
3
  <slot />
4
4
  </div>
5
5
  </template>
@@ -0,0 +1,42 @@
1
+ <script setup lang="ts">
2
+ const props = defineProps<{
3
+ color?: string
4
+ neutral?: boolean
5
+ primary?: boolean
6
+ secondary?: boolean
7
+ accent?: boolean
8
+ info?: boolean
9
+ success?: boolean
10
+ warning?: boolean
11
+ error?: boolean
12
+
13
+ size?: 'xl' | 'lg' | 'md' | 'sm' | 'xs'
14
+ xl?: boolean
15
+ lg?: boolean
16
+ md?: boolean
17
+ sm?: boolean
18
+ xs?: boolean
19
+ }>()
20
+ </script>
21
+
22
+ <template>
23
+ <span
24
+ class="loading loading-ball"
25
+ :class="{
26
+ 'text-primary': props.primary || props.color === 'primary',
27
+ 'text-secondary': props.secondary || props.color === 'secondary',
28
+ 'text-neutral': props.neutral || props.color === 'neutral',
29
+ 'text-accent': props.accent || props.color === 'accent',
30
+ 'text-info': props.info || props.color === 'info',
31
+ 'text-success': props.success || props.color === 'success',
32
+ 'text-warning': props.warning || props.color === 'warning',
33
+ 'text-error': props.error || props.color === 'error',
34
+
35
+ 'loading-xl': props.xl || props.size === 'xl',
36
+ 'loading-lg': props.lg || props.size === 'lg',
37
+ 'loading-md': props.md || props.size === 'md',
38
+ 'loading-sm': props.sm || props.size === 'sm',
39
+ 'loading-xs': props.xs || props.size === 'xs',
40
+ }"
41
+ />
42
+ </template>
@@ -0,0 +1,42 @@
1
+ <script setup lang="ts">
2
+ const props = defineProps<{
3
+ color?: string
4
+ neutral?: boolean
5
+ primary?: boolean
6
+ secondary?: boolean
7
+ accent?: boolean
8
+ info?: boolean
9
+ success?: boolean
10
+ warning?: boolean
11
+ error?: boolean
12
+
13
+ size?: 'xl' | 'lg' | 'md' | 'sm' | 'xs'
14
+ xl?: boolean
15
+ lg?: boolean
16
+ md?: boolean
17
+ sm?: boolean
18
+ xs?: boolean
19
+ }>()
20
+ </script>
21
+
22
+ <template>
23
+ <span
24
+ class="loading loading-bars"
25
+ :class="{
26
+ 'text-primary': props.primary || props.color === 'primary',
27
+ 'text-secondary': props.secondary || props.color === 'secondary',
28
+ 'text-neutral': props.neutral || props.color === 'neutral',
29
+ 'text-accent': props.accent || props.color === 'accent',
30
+ 'text-info': props.info || props.color === 'info',
31
+ 'text-success': props.success || props.color === 'success',
32
+ 'text-warning': props.warning || props.color === 'warning',
33
+ 'text-error': props.error || props.color === 'error',
34
+
35
+ 'loading-xl': props.xl || props.size === 'xl',
36
+ 'loading-lg': props.lg || props.size === 'lg',
37
+ 'loading-md': props.md || props.size === 'md',
38
+ 'loading-sm': props.sm || props.size === 'sm',
39
+ 'loading-xs': props.xs || props.size === 'xs',
40
+ }"
41
+ />
42
+ </template>
@@ -0,0 +1,42 @@
1
+ <script setup lang="ts">
2
+ const props = defineProps<{
3
+ color?: string
4
+ neutral?: boolean
5
+ primary?: boolean
6
+ secondary?: boolean
7
+ accent?: boolean
8
+ info?: boolean
9
+ success?: boolean
10
+ warning?: boolean
11
+ error?: boolean
12
+
13
+ size?: 'xl' | 'lg' | 'md' | 'sm' | 'xs'
14
+ xl?: boolean
15
+ lg?: boolean
16
+ md?: boolean
17
+ sm?: boolean
18
+ xs?: boolean
19
+ }>()
20
+ </script>
21
+
22
+ <template>
23
+ <span
24
+ class="loading loading-dots"
25
+ :class="{
26
+ 'text-primary': props.primary || props.color === 'primary',
27
+ 'text-secondary': props.secondary || props.color === 'secondary',
28
+ 'text-neutral': props.neutral || props.color === 'neutral',
29
+ 'text-accent': props.accent || props.color === 'accent',
30
+ 'text-info': props.info || props.color === 'info',
31
+ 'text-success': props.success || props.color === 'success',
32
+ 'text-warning': props.warning || props.color === 'warning',
33
+ 'text-error': props.error || props.color === 'error',
34
+
35
+ 'loading-xl': props.xl || props.size === 'xl',
36
+ 'loading-lg': props.lg || props.size === 'lg',
37
+ 'loading-md': props.md || props.size === 'md',
38
+ 'loading-sm': props.sm || props.size === 'sm',
39
+ 'loading-xs': props.xs || props.size === 'xs',
40
+ }"
41
+ />
42
+ </template>
@@ -0,0 +1,42 @@
1
+ <script setup lang="ts">
2
+ const props = defineProps<{
3
+ color?: string
4
+ neutral?: boolean
5
+ primary?: boolean
6
+ secondary?: boolean
7
+ accent?: boolean
8
+ info?: boolean
9
+ success?: boolean
10
+ warning?: boolean
11
+ error?: boolean
12
+
13
+ size?: 'xl' | 'lg' | 'md' | 'sm' | 'xs'
14
+ xl?: boolean
15
+ lg?: boolean
16
+ md?: boolean
17
+ sm?: boolean
18
+ xs?: boolean
19
+ }>()
20
+ </script>
21
+
22
+ <template>
23
+ <span
24
+ class="loading loading-infinity"
25
+ :class="{
26
+ 'text-primary': props.primary || props.color === 'primary',
27
+ 'text-secondary': props.secondary || props.color === 'secondary',
28
+ 'text-neutral': props.neutral || props.color === 'neutral',
29
+ 'text-accent': props.accent || props.color === 'accent',
30
+ 'text-info': props.info || props.color === 'info',
31
+ 'text-success': props.success || props.color === 'success',
32
+ 'text-warning': props.warning || props.color === 'warning',
33
+ 'text-error': props.error || props.color === 'error',
34
+
35
+ 'loading-xl': props.xl || props.size === 'xl',
36
+ 'loading-lg': props.lg || props.size === 'lg',
37
+ 'loading-md': props.md || props.size === 'md',
38
+ 'loading-sm': props.sm || props.size === 'sm',
39
+ 'loading-xs': props.xs || props.size === 'xs',
40
+ }"
41
+ />
42
+ </template>
@@ -0,0 +1,42 @@
1
+ <script setup lang="ts">
2
+ const props = defineProps<{
3
+ color?: string
4
+ neutral?: boolean
5
+ primary?: boolean
6
+ secondary?: boolean
7
+ accent?: boolean
8
+ info?: boolean
9
+ success?: boolean
10
+ warning?: boolean
11
+ error?: boolean
12
+
13
+ size?: 'xl' | 'lg' | 'md' | 'sm' | 'xs'
14
+ xl?: boolean
15
+ lg?: boolean
16
+ md?: boolean
17
+ sm?: boolean
18
+ xs?: boolean
19
+ }>()
20
+ </script>
21
+
22
+ <template>
23
+ <span
24
+ class="loading loading-ring"
25
+ :class="{
26
+ 'text-primary': props.primary || props.color === 'primary',
27
+ 'text-secondary': props.secondary || props.color === 'secondary',
28
+ 'text-neutral': props.neutral || props.color === 'neutral',
29
+ 'text-accent': props.accent || props.color === 'accent',
30
+ 'text-info': props.info || props.color === 'info',
31
+ 'text-success': props.success || props.color === 'success',
32
+ 'text-warning': props.warning || props.color === 'warning',
33
+ 'text-error': props.error || props.color === 'error',
34
+
35
+ 'loading-xl': props.xl || props.size === 'xl',
36
+ 'loading-lg': props.lg || props.size === 'lg',
37
+ 'loading-md': props.md || props.size === 'md',
38
+ 'loading-sm': props.sm || props.size === 'sm',
39
+ 'loading-xs': props.xs || props.size === 'xs',
40
+ }"
41
+ />
42
+ </template>
@@ -0,0 +1,42 @@
1
+ <script setup lang="ts">
2
+ const props = defineProps<{
3
+ color?: string
4
+ neutral?: boolean
5
+ primary?: boolean
6
+ secondary?: boolean
7
+ accent?: boolean
8
+ info?: boolean
9
+ success?: boolean
10
+ warning?: boolean
11
+ error?: boolean
12
+
13
+ size?: 'xl' | 'lg' | 'md' | 'sm' | 'xs'
14
+ xl?: boolean
15
+ lg?: boolean
16
+ md?: boolean
17
+ sm?: boolean
18
+ xs?: boolean
19
+ }>()
20
+ </script>
21
+
22
+ <template>
23
+ <span
24
+ class="loading loading-spinner"
25
+ :class="{
26
+ 'text-primary': props.primary || props.color === 'primary',
27
+ 'text-secondary': props.secondary || props.color === 'secondary',
28
+ 'text-neutral': props.neutral || props.color === 'neutral',
29
+ 'text-accent': props.accent || props.color === 'accent',
30
+ 'text-info': props.info || props.color === 'info',
31
+ 'text-success': props.success || props.color === 'success',
32
+ 'text-warning': props.warning || props.color === 'warning',
33
+ 'text-error': props.error || props.color === 'error',
34
+
35
+ 'loading-xl': props.xl || props.size === 'xl',
36
+ 'loading-lg': props.lg || props.size === 'lg',
37
+ 'loading-md': props.md || props.size === 'md',
38
+ 'loading-sm': props.sm || props.size === 'sm',
39
+ 'loading-xs': props.xs || props.size === 'xs',
40
+ }"
41
+ />
42
+ </template>
@@ -0,0 +1,49 @@
1
+ <script setup lang="ts">
2
+ const props = defineProps<{
3
+ shape?: string
4
+ squircle?: boolean
5
+ heart?: boolean
6
+ hexagon?: boolean
7
+ hexagon2?: boolean
8
+ decagon?: boolean
9
+ pentagon?: boolean
10
+ diamond?: boolean
11
+ square?: boolean
12
+ circle?: boolean
13
+ star?: boolean
14
+ star2?: boolean
15
+ triangle?: boolean
16
+ triangle2?: boolean
17
+ triangle3?: boolean
18
+ triangle4?: boolean
19
+ half1?: boolean
20
+ half2?: boolean
21
+ }>()
22
+ </script>
23
+
24
+ <template>
25
+ <div
26
+ class="mask"
27
+ :class="{
28
+ 'mask-squircle': props.squircle || props.shape === 'squircle',
29
+ 'mask-heart': props.heart || props.shape === 'heart',
30
+ 'mask-hexagon': props.hexagon || props.shape === 'hexagon',
31
+ 'mask-hexagon-2': props.hexagon2 || props.shape === 'hexagon-2',
32
+ 'mask-decagon': props.decagon || props.shape === 'decagon',
33
+ 'mask-pentagon': props.pentagon || props.shape === 'pentagon',
34
+ 'mask-diamond': props.diamond || props.shape === 'diamond',
35
+ 'mask-square': props.square || props.shape === 'square',
36
+ 'mask-circle': props.circle || props.shape === 'circle',
37
+ 'mask-star': props.star || props.shape === 'star',
38
+ 'mask-star-2': props.star2 || props.shape === 'star-2',
39
+ 'mask-triangle': props.triangle || props.shape === 'triangle',
40
+ 'mask-triangle-2': props.triangle2 || props.shape === 'triangle-2',
41
+ 'mask-triangle-3': props.triangle3 || props.shape === 'triangle-3',
42
+ 'mask-triangle-4': props.triangle4 || props.shape === 'triangle-4',
43
+ 'mask-half-1': props.half1 || props.shape === 'half-1',
44
+ 'mask-half-2': props.half2 || props.shape === 'half-2',
45
+ }"
46
+ >
47
+ <slot />
48
+ </div>
49
+ </template>
@@ -0,0 +1,30 @@
1
+ <script setup lang="ts">
2
+ const props = defineProps<{
3
+ align?: 'vertical' | 'horizontal'
4
+ vertical?: boolean
5
+ horizontal?: boolean
6
+ size?: 'xl' | 'lg' | 'md' | 'sm' | 'xs'
7
+ xl?: boolean
8
+ lg?: boolean
9
+ md?: boolean
10
+ sm?: boolean
11
+ xs?: boolean
12
+ }>()
13
+ </script>
14
+
15
+ <template>
16
+ <ul
17
+ class="menu"
18
+ :class="{
19
+ 'menu-vertical': props.vertical || props.align === 'vertical',
20
+ 'menu-horizontal': props.horizontal || props.align === 'horizontal',
21
+ 'menu-xl': props.xl || props.size === 'xl',
22
+ 'menu-lg': props.lg || props.size === 'lg',
23
+ 'menu-md': props.md || props.size === 'md',
24
+ 'menu-sm': props.sm || props.size === 'sm',
25
+ 'menu-xs': props.xs || props.size === 'xs',
26
+ }"
27
+ >
28
+ <slot />
29
+ </ul>
30
+ </template>
@@ -0,0 +1,100 @@
1
+ <script setup lang="ts">
2
+ import type { Ref } from 'vue'
3
+
4
+ import { onClickOutside, useElementHover } from '@vueuse/core'
5
+ import { onMounted, provide, ref } from 'vue'
6
+ import { randomString } from '../utils/random-string'
7
+
8
+ // Define the MenuExpandState interface
9
+ export interface MenuExpandState {
10
+ id: string
11
+ isOpen: Ref<boolean>
12
+ toggle: () => void
13
+ open: () => void
14
+ close: () => void
15
+ }
16
+
17
+ // Props with defaults
18
+ const {
19
+ randomId = randomString(12),
20
+ hover = false,
21
+ delayLeave = 300,
22
+ closeOnClickOutside = false,
23
+ } = defineProps<{
24
+ randomId?: string
25
+ hover?: boolean
26
+ delayLeave?: number
27
+ closeOnClickOutside?: boolean
28
+ }>()
29
+
30
+ // v-model for open state
31
+ const isOpen = defineModel('open', { default: false, type: Boolean })
32
+
33
+ // Generate IDs for accessibility and targeting
34
+ const wrapperId = `expand-wrapper-${randomId}`
35
+ const id = `expand-${randomId}`
36
+
37
+ // Element reference for click outside detection
38
+ const expandEl = ref()
39
+
40
+ // Control functions
41
+ function toggle() {
42
+ setTimeout(() => {
43
+ isOpen.value = !isOpen.value
44
+ }, 50)
45
+ }
46
+
47
+ function open() {
48
+ isOpen.value = true
49
+ }
50
+
51
+ function close() {
52
+ isOpen.value = false
53
+ }
54
+
55
+ // Create and provide the menu expand state object
56
+ const menuExpandState: MenuExpandState = {
57
+ id,
58
+ isOpen,
59
+ toggle,
60
+ open,
61
+ close,
62
+ }
63
+
64
+ // Provide the state to child components
65
+ provide('menuExpandState', menuExpandState)
66
+
67
+ // Setup event handlers
68
+ onMounted(() => {
69
+ // Handle clicks outside the component
70
+ onClickOutside(expandEl, () => {
71
+ if (closeOnClickOutside) {
72
+ setTimeout(() => {
73
+ isOpen.value = false
74
+ }, 500)
75
+ }
76
+ })
77
+
78
+ // Setup hover behavior if enabled
79
+ if (hover) {
80
+ useElementHover(expandEl, {
81
+ delayLeave,
82
+ })
83
+ }
84
+ })
85
+
86
+ // Empty click handler for internal use
87
+ function handleClick(_ev: MouseEvent) {}
88
+ </script>
89
+
90
+ <template>
91
+ <details
92
+ :id="wrapperId"
93
+ ref="expandEl"
94
+ class="dropdown menu-expand"
95
+ :open="isOpen"
96
+ @click="handleClick"
97
+ >
98
+ <slot v-bind="{ toggle, open, close }" />
99
+ </details>
100
+ </template>
@@ -1,9 +1,10 @@
1
- <script setup>
1
+ <script setup lang="ts">
2
+ import type { MenuExpandState } from './MenuExpand.vue'
3
+
2
4
  import { inject } from 'vue'
3
5
 
4
- const id = inject('expandId')
5
- const isOpen = inject('isExpandOpen')
6
- const toggle = inject('toggleExpand')
6
+ const menuExpandState = inject<MenuExpandState>('menuExpandState')
7
+ const { id, isOpen, toggle } = menuExpandState || {}
7
8
  </script>
8
9
 
9
10
  <template>
@@ -1,12 +1,11 @@
1
1
  <script setup lang="ts">
2
2
  defineProps<{
3
- active?: boolean
4
3
  disabled?: boolean
5
4
  }>()
6
5
  </script>
7
6
 
8
7
  <template>
9
- <li class="menu-item" :class="{ active, disabled }">
8
+ <li class="menu-item" :class="{ 'menu-disabled': disabled }">
10
9
  <slot />
11
10
  </li>
12
11
  </template>
@@ -16,11 +15,11 @@ defineProps<{
16
15
  Allow adding .active class to the MenuItem element.
17
16
  DaisyUI only supports adding it to the `a` element.
18
17
  */
19
- .menu-item.active > a, .menu-item.active > span {
18
+ .menu-item.menu-active > a, .menu-item.menu-active > span {
20
19
  background-color: hsl(var(--n) / var(--tw-bg-opacity));
21
20
  color: hsl(var(--nc) / var(--tw-text-opacity));
22
21
  }
23
- .menu-item.disabled > a, .menu-item.disabled > span {
22
+ .menu-item.menu-disabled > a, .menu-item.menu-disabled > span {
24
23
  background-color: var(--n)
25
24
  }
26
25
 
@@ -0,0 +1,14 @@
1
+ <script lang="ts" setup>
2
+ defineProps<{
3
+ displayClasses?: string
4
+ }>()
5
+ </script>
6
+
7
+ <template>
8
+ <div class="mockup-phone">
9
+ <div class="mockup-phone-camera" />
10
+ <div class="mockup-phone-display" :class="displayClasses">
11
+ <slot />
12
+ </div>
13
+ </div>
14
+ </template>
@@ -1,12 +1,17 @@
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 = defineProps<{
4
+ const props = withDefaults(defineProps<{
5
5
  modelValue?: boolean
6
6
  closeOnClickOutside?: boolean
7
+ placement?: 'top' | 'bottom' | 'start' | 'end'
7
8
  top?: boolean
8
9
  bottom?: boolean
9
- }>()
10
+ start?: boolean
11
+ end?: boolean
12
+ }>(), {
13
+ closeOnClickOutside: true,
14
+ })
10
15
  const emit = defineEmits(['update:modelValue'])
11
16
 
12
17
  const is = 'div'
@@ -20,14 +25,16 @@ const isOpen = computed({
20
25
  get: () => _isOpen.value,
21
26
  set: (val) => {
22
27
  _isOpen.value = val
23
- if (props.modelValue !== val)
28
+ if (props.modelValue !== val) {
24
29
  emit('update:modelValue', val)
30
+ }
25
31
  },
26
32
  })
27
33
 
28
34
  function handleClick() {
29
- if (props.closeOnClickOutside)
35
+ if (props.closeOnClickOutside) {
30
36
  isOpen.value = false
37
+ }
31
38
  }
32
39
  </script>
33
40
 
@@ -40,6 +47,8 @@ function handleClick() {
40
47
  :class="{
41
48
  'modal-top': props.top,
42
49
  'modal-bottom': props.bottom,
50
+ 'modal-start': props.start,
51
+ 'modal-end': props.end,
43
52
  }"
44
53
  @click.self="handleClick"
45
54
  >